Code hint not narrowed properly on union of literal tupleΒ #46457
Open
Description
Bug Report
π Search Terms
- code hint tuple
- code hint union
π Version & Regression Information
4.4.4
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about _________
β― Playground Link
Playground link with relevant code
π» Code
let value: ['a', 'v1'] | ['b', 'v2'] = ['a', 'v']; // Type 'v' here and get code hint
π Actual behavior
The first element is 'a'
, so the type of value should be narrowed to ['a', 'v1']
.
So that the code hint of the second element should only have 'v1'
, but actually got 'v1' | 'v2'
.
The compile result is correct, but it is not consistent with code hint.