mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
25 lines
701 B
Plaintext
25 lines
701 B
Plaintext
constructorDefaultValuesReferencingThis.ts(15,21): error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class.
|
|
|
|
|
|
==== constructorDefaultValuesReferencingThis.ts (1 errors) ====
|
|
class C {
|
|
public baseProp = 1;
|
|
constructor(x = this) { }
|
|
}
|
|
|
|
class D<T> {
|
|
constructor(x = this) { }
|
|
}
|
|
|
|
class E<T> {
|
|
constructor(public x = this) { }
|
|
}
|
|
|
|
class F extends C {
|
|
constructor(y = this.baseProp) {
|
|
~~~~
|
|
!!! error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class.
|
|
super();
|
|
}
|
|
}
|
|
|