Code hint not narrowed properly on union of literal tuple #46457
Labels
Bug
A bug in TypeScript
Domain: Completion Lists
The issue relates to showing completion lists in an editor
Effort: Casual
Good issue if you're already used to contributing to the codebase. Harder than "good first issue".
Help Wanted
You can do this
Milestone
Bug Report
π Search Terms
π Version & Regression Information
4.4.4
β― Playground Link
Playground link with relevant code
π» Code
π 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.
π Expected behavior
The text was updated successfully, but these errors were encountered: