-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed as not planned
Labels
Won't FixThe severity and priority of this issue do not warrant the time or complexity needed to fix itThe severity and priority of this issue do not warrant the time or complexity needed to fix it
Description
Bug Report
🔎 Search Terms
Variable is used before being assigned ts(2454)
🕗 Version & Regression Information
According to TypeScript Playground error appears for TypeScript versions >= 3.3.3 && <= 4.5.4
and for latest nightly 4.6.4-dev.20220112
. For versions ``, 3.5.1
and `3.6.3` no error happens.
⏯ Playground Link
Playground link with relevant code
💻 Code
let value: 'fail' | 'ok';
try {
value = 'ok';
} catch (error) {
value = 'fail';
} finally {
console.log(value);
}
🙁 Actual behavior
Error Variable 'status' is used before being assigned.ts(2454)
at finally
block.
🙂 Expected behavior
Expect provided code sample has no error at finally
block, because variable status
will be surely initialized.
tamlyn
Metadata
Metadata
Assignees
Labels
Won't FixThe severity and priority of this issue do not warrant the time or complexity needed to fix itThe severity and priority of this issue do not warrant the time or complexity needed to fix it