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

50 lines
1.8 KiB
Plaintext
Raw Normal View History

2014-07-13 01:04:16 +02:00
==== tests/cases/compiler/illegalSuperCallsInConstructor.ts (8 errors) ====
class Base {
x: string;
}
class Derived extends Base {
constructor() {
~~~~~~~~~~~~~~~
var r2 = () => super();
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~
!!! Super calls are not permitted outside constructors or in nested functions inside constructors
var r3 = () => { super(); }
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~
!!! Super calls are not permitted outside constructors or in nested functions inside constructors
var r4 = function () { super(); }
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~
!!! Super calls are not permitted outside constructors or in nested functions inside constructors
var r5 = {
~~~~~~~~~~~~~~~~~~
get foo() {
~~~
!!! 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 foo(v: number) {
~~~
!!! Accessors are only available when targeting ECMAScript 5 and higher.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
super();
~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~
!!! Super calls are not permitted outside constructors or in nested functions inside constructors
}
~~~~~~~~~~~~~
}
~~~~~~~~~
}
~~~~~
!!! Constructors for derived classes must contain a 'super' call.
}