We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
control flow analysis, unreachable code
Tested in 5.8.2
https://www.typescriptlang.org/play/?allowUnreachableCode=true#code/GYVwdgxgLglg9mABFApgZygCgIYC5FggC2ARigE6IA+i4AJisDGCnQJT4BucMdiA3gChEiGMESYo5ECjYDhIxORRQQ5MAG4FAXwViJ2RAEIAvCdpgGTFu3mLEEBBkQl8hUhUTnsW+47BocAA2KAB0QXAA5pgkbL6IutpAA
function test(a: number | undefined): void { if (true) { return; } if (a !== undefined) { const b: number = a; console.log(b); } }
Type 'number | undefined' is not assignable to type 'number'. Type 'undefined' is not assignable to type 'number'.
Code compiles without error.
No response
The text was updated successfully, but these errors were encountered:
Duplicate of #26914.
Sorry, something went wrong.
No branches or pull requests
π Search Terms
control flow analysis, unreachable code
π Version & Regression Information
Tested in 5.8.2
β― Playground Link
https://www.typescriptlang.org/play/?allowUnreachableCode=true#code/GYVwdgxgLglg9mABFApgZygCgIYC5FggC2ARigE6IA+i4AJisDGCnQJT4BucMdiA3gChEiGMESYo5ECjYDhIxORRQQ5MAG4FAXwViJ2RAEIAvCdpgGTFu3mLEEBBkQl8hUhUTnsW+47BocAA2KAB0QXAA5pgkbL6IutpAA
π» Code
π Actual behavior
π Expected behavior
Code compiles without error.
Additional information about the issue
No response
The text was updated successfully, but these errors were encountered: