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
{{ message }}
Repository navigation
Inconsistent treatment of non-widening string literal types and += #13865
I'm seeing some inconsistent and confusing behavior regarding non-widening string literal types.
The type checker treats ... += ... differently than ... = ... + ... which looks like a bug to me.
Code:
Example 1:
constempty: ""="";letfoo=empty;foo+="bar";// OK
Example 2:
constempty: ""="";letfoo=empty;foo=foo+"bar";// Error: Type 'string' is not assignable to type '""'.
Expected behavior: Either both examples type-check correctly or none of them do.
Actual behavior: Example 1 type-checks correctly while Example 2 doesn't.
Activity
2 remaining items