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

16 lines
574 B
Text
Raw Normal View History

2014-07-13 01:04:16 +02:00
==== tests/cases/compiler/thisInConstructorParameter2.ts (3 errors) ====
class P {
x = this;
static y = this;
~~~~
!!! 'this' cannot be referenced in a static property initializer.
constructor(public z = this, zz = this) { }
~~~~
!!! 'this' cannot be referenced in constructor arguments.
~~~~
!!! 'this' cannot be referenced in constructor arguments.
foo(zz = this) { zz.x; }
static bar(zz = this) { zz.y; }
}