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
typeCombine<C,Propextendsstring>={[KeyinkeyofC]: (C[Key]extends{[XinProp]: infer Just} ? Just :
C[Key]extends{[XinProp]?: infer Maybe} ? (Maybe|undefined) :
undefined)}typeTest={x: {test?: boolean,},y: {test?: boolean,},}typeCombined=Combine<Test,'test'>letcombined: Combined// Type '{}' is not assignable to type 'boolean'.letflag: boolean=combined.x
Expected behavior:
Should compile, as the type of combined.x should be boolean.
Actual behavior:
In 2.9+, fails with "Type '{}' is not assignable to type 'boolean'."
TypeScript Version: 3.0.0-dev.20180607
Search Terms:
conditional inference empty infer extends mapped
Code
Expected behavior:
Should compile, as the type of
combined.x
should be boolean.Actual behavior:
In 2.9+, fails with "Type '{}' is not assignable to type 'boolean'."
In 2.8.1, compiles without error.
Playground Link:
Playground link
Related Issues:
The text was updated successfully, but these errors were encountered: