18 lines
653 B
Plaintext
18 lines
653 B
Plaintext
==== tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorDefaultValuesReferencingThis.ts (3 errors) ====
|
|
class C {
|
|
constructor(x = this) { }
|
|
~~~~
|
|
!!! error TS2333: 'this' cannot be referenced in constructor arguments.
|
|
}
|
|
|
|
class D<T> {
|
|
constructor(x = this) { }
|
|
~~~~
|
|
!!! error TS2333: 'this' cannot be referenced in constructor arguments.
|
|
}
|
|
|
|
class E<T> {
|
|
constructor(public x = this) { }
|
|
~~~~
|
|
!!! error TS2333: 'this' cannot be referenced in constructor arguments.
|
|
} |