[Feature Request] The type checker should be able to infer string values of fields being switched on and match them to string literal types #49430
Labels
Duplicate
An existing issue was already created
Bug Report
π Search Terms
switch
"string literal"
π Version & Regression Information
β― Playground Link
Playground link with relevant code
π» Code
π Actual behavior
Type checking fails to be able to infer the string value in the passed argument matches the string literal value in the type
π Expected behavior
The type checker should know that inside the
case
statement,i.field === "a"
and pass the type checkThe text was updated successfully, but these errors were encountered: