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
TypeScript Version: next (3.4.0-dev.20190330), latest (3.4.1)
Search Terms:
tuple conditional type
tuple compare
tuple comparison
Code
typeNot<Textendsboolean>=[T]extends[true] ? false : true;typeNoOp<Textendsboolean>=Not<Not<T>>;// always expands true (see intellisense)typet0=Not<Not<false>>;// falsetypet1=NoOp<false>;// true (but should be false)
Expected behavior:
Type t1 must be false and NoOp must be of the nested conditional type that depends on T, but not of simple true unit type. Actual behavior:
As you see, something is broken when you use generic argument for tuple comparison in conditional type, because when you expand your types manually (t0 is an expanded representation of t1) it works as expected.