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
Is it correct that sealed object properties are not checked in conditional statements?
For example:
// Create a sealed objectconsto={Foo: 'Foo',};// Reports an Errorconstfooz=o.Fooz;// Reports an Errorconstx=o.Fooz==='Bar';// Does not report an errorif(o.Fooz==='Bar'){}// Does not report an errorconsty=(o.Fooz==='Bar') ? true : false;
Edit: Added some more examples. It looks like intermediate expressions (the if statement and the ternary) do not have the type check applied.
The text was updated successfully, but these errors were encountered:
Is it correct that sealed object properties are not checked in conditional statements?
For example:
Edit: Added some more examples. It looks like intermediate expressions (the if statement and the ternary) do not have the type check applied.
The text was updated successfully, but these errors were encountered: