25 lines
No EOL
630 B
Text
25 lines
No EOL
630 B
Text
tests/cases/compiler/thisInSuperCall2.ts(16,15): error TS2332: 'this' cannot be referenced in current location.
|
|
|
|
|
|
==== tests/cases/compiler/thisInSuperCall2.ts (1 errors) ====
|
|
class Base {
|
|
constructor(a: any) {}
|
|
}
|
|
|
|
class Foo extends Base {
|
|
public x: number;
|
|
constructor() {
|
|
super(this); // no error
|
|
}
|
|
}
|
|
|
|
|
|
class Foo2 extends Base {
|
|
public x: number = 0;
|
|
constructor() {
|
|
super(this); // error
|
|
~~~~
|
|
!!! error TS2332: 'this' cannot be referenced in current location.
|
|
}
|
|
}
|
|
|