tsc misunderstands possible value of variable (TS2367
)
#48620
Labels
Duplicate
An existing issue was already created
TS2367
)
#48620
Bug Report
In the below code, tsc emmits the error toward
flag = flag === 'B' ? 'B' : 'A';
.error message:
However, if I set
ts-ignore
at the line, compile it, and then run it, the condition can actually betrue
.🔎 Search Terms
This condition will always return
🕗 Version & Regression Information
I tested it by
tsc v4.5.5
on local, andtsc nightly
on Playground.⏯ Playground Link
Playground link with relevant code
The text was updated successfully, but these errors were encountered: