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