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
The issue here is that we don't lift constraints over intersection types. Here's a simpler repro:
functionfoo<Textendsstring|number,Uextendsstring|number>(x: T&U){lety: string|number=x;// Error, but shouldn't be}
We need to lift the individual constraints of T and U such that the intersection type T & U appears to have the constraint string | number (formed by intersecting the individual constraints of T and U).
TypeScript Version: 2.9.0-dev.20180424
Search Terms:
keyof, intersection, conditional types
Code
Expected behavior:
No errors.
Actual behavior:
Error on
K
inUnexpectedError<K>
with messagePlayground Link:
Link (no error in playground)
Related Issues:
#23592
The text was updated successfully, but these errors were encountered: