Closed
Description
TypeScript Version: 3.8.0-dev.20200125
Search Terms:
Code
// @target: esnext
// @useDefineForClassFields. true
class C {
constructor(public foo: string) {}
}
class D extends C {
bar = this.foo;
}
Expected behavior:
No error. The constructor of C
(and therefore the initialization of foo
) is already executed when bar
is initialized.
Actual behavior:
used before initialization error on this.foo