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

31 lines
908 B
Plaintext

tests/cases/compiler/thisInSuperCall.ts(14,15): error TS2332: 'this' cannot be referenced in current location.
tests/cases/compiler/thisInSuperCall.ts(20,15): error TS2332: 'this' cannot be referenced in current location.
==== tests/cases/compiler/thisInSuperCall.ts (2 errors) ====
class Base {
constructor(x: any) {}
}
class Foo extends Base {
constructor() {
super(this); // no error
}
}
class Foo2 extends Base {
public p = 0;
constructor() {
super(this); // error
~~~~
!!! error TS2332: 'this' cannot be referenced in current location.
}
}
class Foo3 extends Base {
constructor(public p) {
super(this); // error
~~~~
!!! error TS2332: 'this' cannot be referenced in current location.
}
}