mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
73 lines
3.9 KiB
Plaintext
73 lines
3.9 KiB
Plaintext
derivedClassSuperCallsInNonConstructorMembers.ts(4,5): error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor.
|
|
derivedClassSuperCallsInNonConstructorMembers.ts(8,8): error TS2304: Cannot find name 'super'.
|
|
derivedClassSuperCallsInNonConstructorMembers.ts(8,13): error TS1441: Cannot start a function call in a type annotation.
|
|
derivedClassSuperCallsInNonConstructorMembers.ts(8,14): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected.
|
|
derivedClassSuperCallsInNonConstructorMembers.ts(10,9): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors.
|
|
derivedClassSuperCallsInNonConstructorMembers.ts(13,9): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors.
|
|
derivedClassSuperCallsInNonConstructorMembers.ts(17,9): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors.
|
|
derivedClassSuperCallsInNonConstructorMembers.ts(20,15): error TS2304: Cannot find name 'super'.
|
|
derivedClassSuperCallsInNonConstructorMembers.ts(20,20): error TS1441: Cannot start a function call in a type annotation.
|
|
derivedClassSuperCallsInNonConstructorMembers.ts(20,21): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected.
|
|
derivedClassSuperCallsInNonConstructorMembers.ts(22,9): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors.
|
|
derivedClassSuperCallsInNonConstructorMembers.ts(25,9): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors.
|
|
derivedClassSuperCallsInNonConstructorMembers.ts(29,9): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors.
|
|
|
|
|
|
==== derivedClassSuperCallsInNonConstructorMembers.ts (13 errors) ====
|
|
// error to use super calls outside a constructor
|
|
|
|
class Base {
|
|
x: string;
|
|
~
|
|
!!! error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor.
|
|
}
|
|
|
|
class Derived extends Base {
|
|
a: super();
|
|
~~~~~
|
|
!!! error TS2304: Cannot find name 'super'.
|
|
~
|
|
!!! error TS1441: Cannot start a function call in a type annotation.
|
|
~
|
|
!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected.
|
|
b() {
|
|
super();
|
|
~~~~~
|
|
!!! error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors.
|
|
}
|
|
get C() {
|
|
super();
|
|
~~~~~
|
|
!!! error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors.
|
|
return 1;
|
|
}
|
|
set C(v) {
|
|
super();
|
|
~~~~~
|
|
!!! error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors.
|
|
}
|
|
|
|
static a: super();
|
|
~~~~~
|
|
!!! error TS2304: Cannot find name 'super'.
|
|
~
|
|
!!! error TS1441: Cannot start a function call in a type annotation.
|
|
~
|
|
!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected.
|
|
static b() {
|
|
super();
|
|
~~~~~
|
|
!!! error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors.
|
|
}
|
|
static get C() {
|
|
super();
|
|
~~~~~
|
|
!!! error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors.
|
|
return 1;
|
|
}
|
|
static set C(v) {
|
|
super();
|
|
~~~~~
|
|
!!! error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors.
|
|
}
|
|
} |