mirror of
https://github.com/swc-project/swc.git
synced 2024-12-01 01:13:56 +03:00
28 lines
479 B
TypeScript
28 lines
479 B
TypeScript
class Base {
|
|
x: string;
|
|
constructor(a) { }
|
|
}
|
|
|
|
class Derived extends Base {
|
|
constructor() {
|
|
super(this); // ok
|
|
}
|
|
}
|
|
|
|
class Derived2 extends Base {
|
|
constructor(public a: string) {
|
|
super(this); // error
|
|
}
|
|
}
|
|
|
|
class Derived3 extends Base {
|
|
constructor(public a: string) {
|
|
super(() => this); // error
|
|
}
|
|
}
|
|
|
|
class Derived4 extends Base {
|
|
constructor(public a: string) {
|
|
super(function () { return this; }); // ok
|
|
}
|
|
} |