TypeScript/tests/baselines/reference/superAccess2.errors.txt
Wenlu Wang dc237b317e
Change static fields emits (#43114)
* use emit into iife

* Update emit

* Revert un-related changes

* Allow super in static context

* Allow this and super in static property declaration

* Add more tests

* Avoid errors

* Accept baseline

* Accept baseline

* Add decorated classes test

* Add errors

* Avoid this in emitter

* make lint happy

* Add class expression tests

* Add computed name test

* Avoid super if target below es6

* Adjust function boundary

* Add internal

* Fix minor CR issues

* accept baseline

* Update behavior

* Avoid spaces

* Make lint happy

* Avoid function boundary utils

* Update baseline

* Avoid errors

* Accept baseline

* Accept baseline

* Accept baseline

* Accept baseline

* Use substitutions

* Full coverage for super, this, merge static and private context

* Fix use-before-def in static fields

Co-authored-by: Ron Buckton <ron.buckton@microsoft.com>
2021-06-25 15:49:27 -07:00

66 lines
3.8 KiB
Plaintext

tests/cases/compiler/superAccess2.ts(7,15): error TS1034: 'super' must be followed by an argument list or member access.
tests/cases/compiler/superAccess2.ts(8,22): error TS1034: 'super' must be followed by an argument list or member access.
tests/cases/compiler/superAccess2.ts(11,28): error TS2336: 'super' cannot be referenced in constructor arguments.
tests/cases/compiler/superAccess2.ts(11,28): error TS17011: 'super' must be called before accessing a property of 'super' in the constructor of a derived class.
tests/cases/compiler/superAccess2.ts(11,33): error TS1034: 'super' must be followed by an argument list or member access.
tests/cases/compiler/superAccess2.ts(11,40): error TS2336: 'super' cannot be referenced in constructor arguments.
tests/cases/compiler/superAccess2.ts(11,40): error TS17011: 'super' must be called before accessing a property of 'super' in the constructor of a derived class.
tests/cases/compiler/superAccess2.ts(11,45): error TS1034: 'super' must be followed by an argument list or member access.
tests/cases/compiler/superAccess2.ts(11,64): error TS1034: 'super' must be followed by an argument list or member access.
tests/cases/compiler/superAccess2.ts(15,19): error TS1034: 'super' must be followed by an argument list or member access.
tests/cases/compiler/superAccess2.ts(17,15): error TS2576: Property 'y' does not exist on type 'P'. Did you mean to access the static member 'P.y' instead?
tests/cases/compiler/superAccess2.ts(20,26): error TS1034: 'super' must be followed by an argument list or member access.
tests/cases/compiler/superAccess2.ts(21,15): error TS2339: Property 'x' does not exist on type 'typeof P'.
==== tests/cases/compiler/superAccess2.ts (13 errors) ====
class P {
x() { }
static y() { }
}
class Q extends P {
xx = super;
~
!!! error TS1034: 'super' must be followed by an argument list or member access.
static yy = super; // error for static initializer accessing super
~
!!! error TS1034: 'super' must be followed by an argument list or member access.
// Super is not allowed in constructor args
constructor(public z = super, zz = super, zzz = () => super) {
~~~~~
!!! error TS2336: 'super' cannot be referenced in constructor arguments.
~~~~~
!!! error TS17011: 'super' must be called before accessing a property of 'super' in the constructor of a derived class.
~
!!! error TS1034: 'super' must be followed by an argument list or member access.
~~~~~
!!! error TS2336: 'super' cannot be referenced in constructor arguments.
~~~~~
!!! error TS17011: 'super' must be called before accessing a property of 'super' in the constructor of a derived class.
~
!!! error TS1034: 'super' must be followed by an argument list or member access.
~
!!! error TS1034: 'super' must be followed by an argument list or member access.
super();
}
foo(zz = super) {
~
!!! error TS1034: 'super' must be followed by an argument list or member access.
super.x();
super.y(); // error
~
!!! error TS2576: Property 'y' does not exist on type 'P'. Did you mean to access the static member 'P.y' instead?
}
static bar(zz = super) {
~
!!! error TS1034: 'super' must be followed by an argument list or member access.
super.x(); // error
~
!!! error TS2339: Property 'x' does not exist on type 'typeof P'.
super.y();
}
}