21 lines
1,012 B
Plaintext
21 lines
1,012 B
Plaintext
tests/cases/compiler/thisInConstructorParameter2.ts(3,16): error TS2334: 'this' cannot be referenced in a static property initializer.
|
|
tests/cases/compiler/thisInConstructorParameter2.ts(5,28): error TS2333: 'this' cannot be referenced in constructor arguments.
|
|
tests/cases/compiler/thisInConstructorParameter2.ts(5,39): error TS2333: 'this' cannot be referenced in constructor arguments.
|
|
|
|
|
|
==== tests/cases/compiler/thisInConstructorParameter2.ts (3 errors) ====
|
|
class P {
|
|
x = this;
|
|
static y = this;
|
|
~~~~
|
|
!!! error TS2334: 'this' cannot be referenced in a static property initializer.
|
|
|
|
constructor(public z = this, zz = this) { }
|
|
~~~~
|
|
!!! error TS2333: 'this' cannot be referenced in constructor arguments.
|
|
~~~~
|
|
!!! error TS2333: 'this' cannot be referenced in constructor arguments.
|
|
|
|
foo(zz = this) { zz.x; }
|
|
static bar(zz = this) { zz.y; }
|
|
} |