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
interfaceIFoo{foo?: number;bar?: number;}leta: IFoo={foo: 1,asd: 2// this line shows error};letb=true;letc: IFoo=b ? {asd: 2// this line shows error} : {foo: 1,asd: 2// this line does NOT show an error}
letc: IFoo=b ? {} : {foo: 1,asd: 2// this line does NOT show an error}
Expected behavior:
All asd:2 assignments should show an error
Actual behavior:
Only the first two show the error, the last one does not.
The text was updated successfully, but these errors were encountered:
DanielRosenwasser
changed the title
Known properties check for object literal does not work with conditional assignment
Excess properties check does not occur for object literals in conditional expressions
Dec 15, 2016
TypeScript Version: 2.1.4 / 2.1.4-insiders.20161201
Code
Code on playground
Also this version fails:
Expected behavior:
All
asd:2
assignments should show an errorActual behavior:
Only the first two show the error, the last one does not.
The text was updated successfully, but these errors were encountered: