55 lines
No EOL
1.5 KiB
Text
55 lines
No EOL
1.5 KiB
Text
==== tests/cases/compiler/superCallInNonStaticMethod.ts (2 errors) ====
|
|
class Doing {
|
|
public instanceMethod() {
|
|
}
|
|
}
|
|
|
|
class Other extends Doing {
|
|
// in instance method
|
|
public instanceMethod() {
|
|
super.instanceMethod();
|
|
}
|
|
|
|
// in a lambda inside a instance method
|
|
public lambdaInsideAnInstanceMethod() {
|
|
() => {
|
|
super.instanceMethod();
|
|
}
|
|
}
|
|
|
|
// in an object literal inside a instance method
|
|
public objectLiteralInsideAnInstanceMethod() {
|
|
return {
|
|
a: () => {
|
|
super.instanceMethod();
|
|
},
|
|
b: super.instanceMethod()
|
|
};
|
|
}
|
|
|
|
// in a getter
|
|
public get accessor() {
|
|
~~~~~~~~
|
|
!!! Accessors are only available when targeting ECMAScript 5 and higher.
|
|
super.instanceMethod();
|
|
|
|
return 0;
|
|
}
|
|
|
|
// in a setter
|
|
public set accessor(value: number) {
|
|
~~~~~~~~
|
|
!!! Accessors are only available when targeting ECMAScript 5 and higher.
|
|
super.instanceMethod();
|
|
}
|
|
|
|
constructor() {
|
|
super();
|
|
super.instanceMethod();
|
|
}
|
|
|
|
public propertyInitializer = super.instanceMethod();
|
|
|
|
public functionProperty = () => {super.instanceMethod(); };
|
|
}
|
|
|