29 lines
797 B
Plaintext
29 lines
797 B
Plaintext
|
==== tests/cases/compiler/superCallOutsideConstructor.ts (3 errors) ====
|
||
|
class C {
|
||
|
foo() { }
|
||
|
}
|
||
|
|
||
|
class D extends C {
|
||
|
x = super();
|
||
|
~~~~~
|
||
|
!!! Super calls are not permitted outside constructors or in nested functions inside constructors
|
||
|
|
||
|
constructor() {
|
||
|
super();
|
||
|
|
||
|
var y = () => {
|
||
|
super();
|
||
|
~~~~~
|
||
|
!!! Super calls are not permitted outside constructors or in nested functions inside constructors
|
||
|
}
|
||
|
|
||
|
var y2 = function() {
|
||
|
super();
|
||
|
~~~~~
|
||
|
!!! Super calls are not permitted outside constructors or in nested functions inside constructors
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
var d = new D();
|
||
|
|