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
bar property sometimes displayed as valid and sometimes produce an error:
Argument of type '{ foo: 1; bar: number; }' is not assignable to parameter of type '{ foo: 1; }'.
Object literal may only specify known properties, and 'bar' does not exist in type '{ foo: 1; }'.(2345)
When playing with the code live and change bar to bar222 or ba sometimes the error shown and sometimes not.
Refreshing the playground link with the changes always remove the error.
Screen.Recording.2022-09-17.at.20.20.57.mov
π Expected behavior
Always display as valid without any error.
{ foo: 1, bar: 1 } is a valid subtype of { foo: 1 } and so can legally be used to instantiate T.
Bug Report
π Search Terms
π Version & Regression Information
β― Playground Link
Playground link with relevant code
π» Code
π Actual behavior
barproperty sometimes displayed as valid and sometimes produce an error:When playing with the code live and change
bartobar222orbasometimes the error shown and sometimes not.Refreshing the playground link with the changes always remove the error.
Screen.Recording.2022-09-17.at.20.20.57.mov
π Expected behavior
Always display as valid without any error.
{ foo: 1, bar: 1 }is a valid subtype of{ foo: 1 }and so can legally be used to instantiateT.Maybe related to #49490