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
constTrue=falseastrue;constone=2as1;conststr='hello'as'str';declareconstfoo: 'foo';fooas'string';declareconstbar: 'foo'|'bar';baras'string';// this should still be allowed:baras'foo';
This only affects literals asserted to a different literal of the same widened type.
These are handled correctly:
1as'str';// Type 1 is not comparable to type "str"['hello']as['str'];// Type "hello" is not comparable to type "str"({a: 'hello'}as{a: 'str'});// Type "hello" is not comparable to type "str"
The text was updated successfully, but these errors were encountered:
microsoft/TypeScript#14156
These are currently no compile error:
This only affects literals asserted to a different literal of the same widened type.
These are handled correctly:
The text was updated successfully, but these errors were encountered: