I ran into this weird case. I declare a conditional type. For the same extends constraint, a type alias satisfies it, while a structurally identical interface doesn't.
I'm so lost, why the difference? Check the playground.
interface Constraint {
[key: string]: string | number | boolean
}
type ATypeAlias = {
str: string
num: number
bool: boolean
}
interface SameInterface {
str: string
num: number
bool: boolean
}
type expectToBeTrue = ATypeAlias extends Constraint ? true : false
// Wat???
type butWhyAmIFalse = SameInterface extends Constraint ? true : false