TypeScript/tests/baselines/reference/derivedClassSuperCallsInNonConstructorMembers.errors.txt
2014-07-12 17:30:19 -07:00

60 lines
2.1 KiB
Plaintext

==== tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts (14 errors) ====
// error to use super calls outside a constructor
class Base {
x: string;
}
class Derived extends Base {
a: super();
~~~~~
!!! Type expected.
~~~~~
!!! Super calls are not permitted outside constructors or in nested functions inside constructors
b() {
super();
~~~~~
!!! Super calls are not permitted outside constructors or in nested functions inside constructors
}
get C() {
~
!!! Accessors are only available when targeting ECMAScript 5 and higher.
super();
~~~~~
!!! Super calls are not permitted outside constructors or in nested functions inside constructors
return 1;
}
set C(v) {
~
!!! Accessors are only available when targeting ECMAScript 5 and higher.
super();
~~~~~
!!! Super calls are not permitted outside constructors or in nested functions inside constructors
}
static a: super();
~~~~~
!!! Type expected.
~~~~~
!!! Super calls are not permitted outside constructors or in nested functions inside constructors
static b() {
super();
~~~~~
!!! Super calls are not permitted outside constructors or in nested functions inside constructors
}
static get C() {
~
!!! Accessors are only available when targeting ECMAScript 5 and higher.
super();
~~~~~
!!! Super calls are not permitted outside constructors or in nested functions inside constructors
return 1;
}
static set C(v) {
~
!!! Accessors are only available when targeting ECMAScript 5 and higher.
super();
~~~~~
!!! Super calls are not permitted outside constructors or in nested functions inside constructors
}
}