2014-09-12 22:35:07 +02:00
|
|
|
tests/cases/compiler/superCallInNonStaticMethod.ts(30,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
|
|
|
tests/cases/compiler/superCallInNonStaticMethod.ts(37,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
|
|
|
|
|
|
|
|
2014-07-13 01:04:16 +02:00
|
|
|
==== 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() {
|
|
|
|
~~~~~~~~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
2014-07-13 01:04:16 +02:00
|
|
|
super.instanceMethod();
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// in a setter
|
|
|
|
public set accessor(value: number) {
|
|
|
|
~~~~~~~~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
2014-07-13 01:04:16 +02:00
|
|
|
super.instanceMethod();
|
|
|
|
}
|
|
|
|
|
|
|
|
constructor() {
|
|
|
|
super();
|
|
|
|
super.instanceMethod();
|
|
|
|
}
|
|
|
|
|
|
|
|
public propertyInitializer = super.instanceMethod();
|
|
|
|
|
|
|
|
public functionProperty = () => {super.instanceMethod(); };
|
|
|
|
}
|
|
|
|
|