Closed
Description
Bug Report
🔎 Search Terms
control flow analysis, class static blocks
🕗 Version & Regression Information
- v4.4.0-beta
- v4.4.0-dev.20210708
- This is the behavior in every version I tried, and I reviewed the proposal
- I was unable to test this on prior versions because class static blocks were added in 4.4.0
⏯ Playground Link
Playground link with relevant code
💻 Code
let foo: number;
class C {
static {
foo = 3;
}
}
console.log(foo);
🙁 Actual behavior
An error Variable 'foo' is used before being assigned.(2454)
occurs at line 10, console.log(foo)
.
🙂 Expected behavior
Code compiles without errors.