TypeScript/tests/baselines/reference/derivedClassSuperCallsInNonConstructorMembers.errors.txt

60 lines
2.1 KiB
Plaintext
Raw Normal View History

2014-07-13 01:04:16 +02:00
==== 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
}
}