Present somehow to user that literal type is a widening literal type #11181
Labels
Suggestion
An idea for TypeScript
Too Complex
An issue which adding support for may be too complex for the value it adds
I'm just adding the task here for your consideration (because it was buried in a comment in some other bug).
With #11126
we have now (literal types and widening literal types) and new rules to remember to understand the resulting inferred type for mutable location:
etc..
Now using this code:
so what I'm asking is - make it more clear for user to figure out why TS behaves in a way it behaves (because right now presenting
Type: a | b
for both cases is misleading and can cause some bugs (or rather prevent bugs from detecting)Maybe VSCode could show:
Thanks a lot for consideration
The text was updated successfully, but these errors were encountered: