27 lines
No EOL
652 B
Text
27 lines
No EOL
652 B
Text
==== 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
|
|
~~~~
|
|
!!! 'this' cannot be referenced in current location.
|
|
}
|
|
}
|
|
|
|
class Foo3 extends Base {
|
|
constructor(public p) {
|
|
super(this); // error
|
|
~~~~
|
|
!!! 'this' cannot be referenced in current location.
|
|
}
|
|
} |