Closed
Description
Bug Report
Hello!
I've encountered this problem after updating my project to the latest TypeScript 4.3.2.
The bug looks similar to #37573.
💻 Code
script.ts
class Foo {
constructor(private value) {
}
anotherValue = this.value;
}
tsconfig.json
{
"compilerOptions": {
"target": "ESNext"
}
}
This happens only when using ESNext
as a target
. Using ES2020
works correctly. Could you also elaborate on the difference of these two settings?
🙁 Actual behavior
I'm getting an error: error TS2729: Property 'value' is used before its initialization.
🙂 Expected behavior
The code should compile just fine.