TypeScript/tests/baselines/reference/constructorDefaultValuesReferencingThis.errors.txt

23 lines
1.2 KiB
Text
Raw Normal View History

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.
2014-07-13 01:04:16 +02:00
==== tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorDefaultValuesReferencingThis.ts (3 errors) ====
class C {
constructor(x = this) { }
~~~~
!!! error TS2333: 'this' cannot be referenced in constructor arguments.
2014-07-13 01:04:16 +02:00
}
class D<T> {
constructor(x = this) { }
~~~~
!!! error TS2333: 'this' cannot be referenced in constructor arguments.
2014-07-13 01:04:16 +02:00
}
class E<T> {
constructor(public x = this) { }
~~~~
!!! error TS2333: 'this' cannot be referenced in constructor arguments.
2014-07-13 01:04:16 +02:00
}