2014-09-12 22:35:07 +02:00
|
|
|
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.
|
|
|
|
|
|
|
|
|
2014-07-13 01:04:16 +02:00
|
|
|
==== 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
|
|
|
|
~~~~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2332: 'this' cannot be referenced in current location.
|
2014-07-13 01:04:16 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class Foo3 extends Base {
|
|
|
|
constructor(public p) {
|
|
|
|
super(this); // error
|
|
|
|
~~~~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2332: 'this' cannot be referenced in current location.
|
2014-07-13 01:04:16 +02:00
|
|
|
}
|
|
|
|
}
|