Closed
Description
π Search Terms
type alias
extends array
different behavior
π Version & Regression Information
This was introduced by version 4.2
, and continues as of today (version 5.3
).
β― Playground Link
π» Code
type A<T> = {a: T extends true[] ? true : false};
type B = A<true[]>; // {a: true}
type C = A<boolean[]>; // {a: false}
type D = A<true[]> extends C ? true : false; // `false`, which is correct
type E = A<true[]> extends A<boolean[]> ? true : false; // `true`, which is incorrect
π Actual behavior
The types D
and E
have different values.
π Expected behavior
The types D
and E
should have the same value since they are identical, except for one using a type alias.
Metadata
Metadata
Assignees
Labels
No labels