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

60 lines
3.2 KiB
Plaintext
Raw Normal View History

tests/cases/compiler/illegalSuperCallsInConstructor.ts(6,5): error TS2377: Constructors for derived classes must contain a 'super' call.
tests/cases/compiler/illegalSuperCallsInConstructor.ts(7,24): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors
tests/cases/compiler/illegalSuperCallsInConstructor.ts(8,26): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors
tests/cases/compiler/illegalSuperCallsInConstructor.ts(9,32): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors
tests/cases/compiler/illegalSuperCallsInConstructor.ts(11,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/illegalSuperCallsInConstructor.ts(12,17): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors
tests/cases/compiler/illegalSuperCallsInConstructor.ts(15,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/illegalSuperCallsInConstructor.ts(16,17): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors
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();
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~
!!! error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors
2014-07-13 01:04:16 +02:00
var r3 = () => { super(); }
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~
!!! error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors
2014-07-13 01:04:16 +02:00
var r4 = function () { super(); }
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~
!!! error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors
2014-07-13 01:04:16 +02:00
var r5 = {
~~~~~~~~~~~~~~~~~~
get foo() {
~~~~~~~~~~~~~~~~~~~~~~~
2014-07-13 01:04:16 +02:00
~~~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
2014-07-13 01:04:16 +02:00
super();
~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~
!!! error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors
2014-07-13 01:04:16 +02:00
return 1;
~~~~~~~~~~~~~~~~~~~~~~~~~
},
~~~~~~~~~~~~~~
set foo(v: number) {
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2014-07-13 01:04:16 +02:00
~~~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
2014-07-13 01:04:16 +02:00
super();
~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~
!!! error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors
2014-07-13 01:04:16 +02:00
}
~~~~~~~~~~~~~
}
~~~~~~~~~
}
~~~~~
!!! error TS2377: Constructors for derived classes must contain a 'super' call.
2014-07-13 01:04:16 +02:00
}