TypeScript/tests/baselines/reference/constructorDefaultValuesReferencingThis.errors.txt
2014-09-12 13:35:07 -07:00

23 lines
1.2 KiB
Plaintext

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.
}