Closed
Description
Does this issue occur when all extensions are disabled?: Yes
- VS Code Version: 1.76.0
- OS Version: Windows 11 22H2 (22621.1265)
Steps to Reproduce:
- Using the following object union type:
type TestType = {
key1: 'a',
key2: '1',
} | {
key1: 'a',
key2: '2',
} | {
key1: 'b',
key2: '3',
}
- Even though
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 thekey2: "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.