You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
typeA<T>={a: Textendstrue[] ? true : false};typeB=A<true[]>;// {a: true}typeC=A<boolean[]>;// {a: false}typeD=A<true[]>extendsC ? true : false;// `false`, which is correcttypeE=A<true[]>extendsA<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.
The text was updated successfully, but these errors were encountered:
ehmicky
changed the title
Different behavior when using a type as is, or as a declared type
Different behavior when using a type as is, or as a type alias
Jan 15, 2024
π Search Terms
type alias
extends array
different behavior
π Version & Regression Information
This was introduced by version
4.2
, and continues as of today (version5.3
).β― Playground Link
https://www.typescriptlang.org/play?ts=5.3.3#code/C4TwDgpgBAggPAFQHxQLxQN4EMBcUFQQAewEAdgCYDOUwATgK4QDaAulAPy2PR4BmWADZUIAXwDcAWABQM0JCgAhNLDj0mbJOKgB6HZlzcmoueGgBhFfABGAe1uCIWMpu16D-ISJPT50ACJWajyahCTk1FCWXOq8UALCEG76AAYJIikANFAA7gAWAJYAxnlQBTRFtnR0EEXApgoAokGxocSklDQ29o7OoTE8UJ6JyVApsVm5hSVlNAVkldW1wEA
π» Code
π Actual behavior
The types
D
andE
have different values.π Expected behavior
The types
D
andE
should have the same value since they are identical, except for one using a type alias.The text was updated successfully, but these errors were encountered: