23 lines
No EOL
1.2 KiB
Text
23 lines
No EOL
1.2 KiB
Text
tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorDefaultValuesReferencingThis.ts(2,21): error TS2333: 'this' cannot be referenced in constructor arguments.
|
|
tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorDefaultValuesReferencingThis.ts(6,21): error TS2333: 'this' cannot be referenced in constructor arguments.
|
|
tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorDefaultValuesReferencingThis.ts(10,28): error TS2333: 'this' cannot be referenced in constructor arguments.
|
|
|
|
|
|
==== 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.
|
|
} |