Intellisense suggests invalid property values within union objects #53165
Labels
Domain: Completion Lists
The issue relates to showing completion lists in an editor
Experience Enhancement
Noncontroversial enhancements
Fix Available
A PR has been opened for this issue
Help Wanted
You can do this
Suggestion
An idea for TypeScript
Milestone
Does this issue occur when all extensions are disabled?: Yes
Steps to Reproduce:
key2: '1' | '2'
when key1 is 'a', VSCode suggest 1, 2 and 3 as b values:The underlying type checker even knows the correct values for key2, and throws a problem if theyre used: (note the
key2: "1" | "2"
part)This causes bigger usability problems when used with larger unions and objects where VSCode spills the suggestions with lots of incorrect ones.
The text was updated successfully, but these errors were encountered: