Skip to content

Commit f4290e1

Browse files
author
Kanchalai Tanglertsampan
committed
Update baselines
1 parent 39c75fd commit f4290e1

11 files changed

+53
-65
lines changed

tests/baselines/reference/baseCheck.errors.txt

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
11
tests/cases/compiler/baseCheck.ts(9,18): error TS2304: Cannot find name 'loc'.
22
tests/cases/compiler/baseCheck.ts(17,53): error TS2346: Supplied parameters do not match any signature of call target.
3-
tests/cases/compiler/baseCheck.ts(17,59): error TS2332: 'this' cannot be referenced in current location.
43
tests/cases/compiler/baseCheck.ts(17,59): error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class.
5-
tests/cases/compiler/baseCheck.ts(18,62): error TS2332: 'this' cannot be referenced in current location.
64
tests/cases/compiler/baseCheck.ts(18,62): error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class.
75
tests/cases/compiler/baseCheck.ts(19,59): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'.
8-
tests/cases/compiler/baseCheck.ts(19,68): error TS2332: 'this' cannot be referenced in current location.
96
tests/cases/compiler/baseCheck.ts(19,68): error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class.
107
tests/cases/compiler/baseCheck.ts(22,9): error TS2304: Cannot find name 'x'.
118
tests/cases/compiler/baseCheck.ts(23,7): error TS2304: Cannot find name 'x'.
129
tests/cases/compiler/baseCheck.ts(26,9): error TS2304: Cannot find name 'x'.
1310

1411

15-
==== tests/cases/compiler/baseCheck.ts (12 errors) ====
12+
==== tests/cases/compiler/baseCheck.ts (9 errors) ====
1613
class C { constructor(x: number, y: number) { } }
1714
class ELoc extends C {
1815
constructor(x: number) {
@@ -35,20 +32,14 @@ tests/cases/compiler/baseCheck.ts(26,9): error TS2304: Cannot find name 'x'.
3532
~~~~~~~~~~~~~
3633
!!! error TS2346: Supplied parameters do not match any signature of call target.
3734
~~~~
38-
!!! error TS2332: 'this' cannot be referenced in current location.
39-
~~~~
4035
!!! error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class.
4136
class E extends C { constructor(public z: number) { super(0, this.z) } }
4237
~~~~
43-
!!! error TS2332: 'this' cannot be referenced in current location.
44-
~~~~
4538
!!! error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class.
4639
class F extends C { constructor(public z: number) { super("hello", this.z) } } // first param type
4740
~~~~~~~
4841
!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'.
4942
~~~~
50-
!!! error TS2332: 'this' cannot be referenced in current location.
51-
~~~~
5243
!!! error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class.
5344

5445
function f() {

tests/baselines/reference/classUpdateTests.errors.txt

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
tests/cases/compiler/classUpdateTests.ts(34,2): error TS2377: Constructors for derived classes must contain a 'super' call.
22
tests/cases/compiler/classUpdateTests.ts(43,18): error TS2335: 'super' can only be referenced in a derived class.
3-
tests/cases/compiler/classUpdateTests.ts(59,3): error TS2376: A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.
3+
tests/cases/compiler/classUpdateTests.ts(57,2): error TS2376: A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.
44
tests/cases/compiler/classUpdateTests.ts(63,7): error TS2415: Class 'L' incorrectly extends base class 'G'.
55
Property 'p1' is private in type 'L' but not in type 'G'.
66
tests/cases/compiler/classUpdateTests.ts(69,7): error TS2415: Class 'M' incorrectly extends base class 'G'.
77
Property 'p1' is private in type 'M' but not in type 'G'.
8-
tests/cases/compiler/classUpdateTests.ts(72,3): error TS2376: A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.
8+
tests/cases/compiler/classUpdateTests.ts(70,2): error TS2376: A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.
99
tests/cases/compiler/classUpdateTests.ts(93,3): error TS1128: Declaration or statement expected.
1010
tests/cases/compiler/classUpdateTests.ts(95,1): error TS1128: Declaration or statement expected.
1111
tests/cases/compiler/classUpdateTests.ts(99,3): error TS1128: Declaration or statement expected.
@@ -80,11 +80,14 @@ tests/cases/compiler/classUpdateTests.ts(113,1): error TS1128: Declaration or st
8080

8181
class K extends G {
8282
constructor(public p1:number) { // ERROR
83+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8384
var i = 0;
85+
~~~~~~~~~~~~
8486
super();
85-
~~~~~~~~
86-
!!! error TS2376: A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.
87+
~~~~~~~~~~
8788
}
89+
~~
90+
!!! error TS2376: A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.
8891
}
8992

9093
class L extends G {
@@ -101,11 +104,14 @@ tests/cases/compiler/classUpdateTests.ts(113,1): error TS1128: Declaration or st
101104
!!! error TS2415: Class 'M' incorrectly extends base class 'G'.
102105
!!! error TS2415: Property 'p1' is private in type 'M' but not in type 'G'.
103106
constructor(private p1:number) { // ERROR
107+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
104108
var i = 0;
109+
~~~~~~~~~~~~
105110
super();
106-
~~~~~~~~
107-
!!! error TS2376: A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.
111+
~~~~~~~~~~
108112
}
113+
~~
114+
!!! error TS2376: A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.
109115
}
110116

111117
//

tests/baselines/reference/derivedClassParameterProperties.errors.txt

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassParameterProperties.ts(17,9): error TS2376: A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.
2-
tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassParameterProperties.ts(32,9): error TS2376: A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.
1+
tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassParameterProperties.ts(15,5): error TS2376: A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.
2+
tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassParameterProperties.ts(30,5): error TS2376: A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.
33
tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassParameterProperties.ts(47,9): error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class.
4+
tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassParameterProperties.ts(56,5): error TS2376: A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.
45
tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassParameterProperties.ts(57,9): error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class.
56
tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassParameterProperties.ts(58,9): error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class.
6-
tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassParameterProperties.ts(59,9): error TS2376: A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.
7+
tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassParameterProperties.ts(79,5): error TS2376: A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.
78
tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassParameterProperties.ts(80,9): error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class.
89
tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassParameterProperties.ts(81,9): error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class.
9-
tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassParameterProperties.ts(82,9): error TS2376: A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.
1010

1111

1212
==== tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassParameterProperties.ts (9 errors) ====
@@ -25,11 +25,14 @@ tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassP
2525

2626
class Derived2 extends Base {
2727
constructor(public y: string) {
28+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2829
var a = 1;
30+
~~~~~~~~~~~~~~~~~~
2931
super(); // error
30-
~~~~~~~~
31-
!!! error TS2376: A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.
32+
~~~~~~~~~~~~~~~~~~~~~~~~~
3233
}
34+
~~~~~
35+
!!! error TS2376: A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.
3336
}
3437

3538
class Derived3 extends Base {
@@ -42,11 +45,14 @@ tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassP
4245
class Derived4 extends Base {
4346
a = 1;
4447
constructor(y: string) {
48+
~~~~~~~~~~~~~~~~~~~~~~~~
4549
var b = 2;
50+
~~~~~~~~~~~~~~~~~~
4651
super(); // error
47-
~~~~~~~~
48-
!!! error TS2376: A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.
52+
~~~~~~~~~~~~~~~~~~~~~~~~~
4953
}
54+
~~~~~
55+
!!! error TS2376: A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.
5056
}
5157

5258
class Derived5 extends Base {
@@ -72,16 +78,20 @@ tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassP
7278
a = 1;
7379
b: number;
7480
constructor(y: string) {
81+
~~~~~~~~~~~~~~~~~~~~~~~~
7582
this.a = 3;
83+
~~~~~~~~~~~~~~~~~~~
7684
~~~~
7785
!!! error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class.
7886
this.b = 3;
87+
~~~~~~~~~~~~~~~~~~~
7988
~~~~
8089
!!! error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class.
8190
super(); // error
82-
~~~~~~~~
83-
!!! error TS2376: A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.
91+
~~~~~~~~~~~~~~~~~~~~~~~~~
8492
}
93+
~~~~~
94+
!!! error TS2376: A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.
8595
}
8696

8797
class Derived8 extends Base {
@@ -101,16 +111,20 @@ tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassP
101111
a = 1;
102112
b: number;
103113
constructor(y: string) {
114+
~~~~~~~~~~~~~~~~~~~~~~~~
104115
this.a = 3;
116+
~~~~~~~~~~~~~~~~~~~
105117
~~~~
106118
!!! error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class.
107119
this.b = 3;
120+
~~~~~~~~~~~~~~~~~~~
108121
~~~~
109122
!!! error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class.
110123
super(); // error
111-
~~~~~~~~
112-
!!! error TS2376: A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.
124+
~~~~~~~~~~~~~~~~~~~~~~~~~
113125
}
126+
~~~~~
127+
!!! error TS2376: A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.
114128
}
115129

116130
class Derived10<T> extends Base2<T> {

tests/baselines/reference/derivedClassSuperCallsWithThisArg.errors.txt

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsWithThisArg.ts(8,15): error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class.
2-
tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsWithThisArg.ts(14,15): error TS2332: 'this' cannot be referenced in current location.
32
tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsWithThisArg.ts(14,15): error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class.
4-
tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsWithThisArg.ts(20,21): error TS2332: 'this' cannot be referenced in current location.
53

64

7-
==== tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsWithThisArg.ts (4 errors) ====
5+
==== tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsWithThisArg.ts (2 errors) ====
86
class Base {
97
x: string;
108
constructor(a) { }
@@ -22,17 +20,13 @@ tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassS
2220
constructor(public a: string) {
2321
super(this); // error
2422
~~~~
25-
!!! error TS2332: 'this' cannot be referenced in current location.
26-
~~~~
2723
!!! error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class.
2824
}
2925
}
3026

3127
class Derived3 extends Base {
3228
constructor(public a: string) {
3329
super(() => this); // error
34-
~~~~
35-
!!! error TS2332: 'this' cannot be referenced in current location.
3630
}
3731
}
3832

tests/baselines/reference/strictModeInConstructor.errors.txt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
tests/cases/compiler/strictModeInConstructor.ts(29,9): error TS2376: A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.
1+
tests/cases/compiler/strictModeInConstructor.ts(27,5): error TS2376: A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.
22

33

44
==== tests/cases/compiler/strictModeInConstructor.ts (1 errors) ====
@@ -29,12 +29,16 @@ tests/cases/compiler/strictModeInConstructor.ts(29,9): error TS2376: A 'super' c
2929
public s: number = 9;
3030

3131
constructor () {
32+
~~~~~~~~~~~~~~~~
3233
var x = 1; // Error
34+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
3335
super();
34-
~~~~~~~~
35-
!!! error TS2376: A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.
36+
~~~~~~~~~~~~~~~~
3637
"use strict";
38+
~~~~~~~~~~~~~~~~~~~~~
3739
}
40+
~~~~~
41+
!!! error TS2376: A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.
3842
}
3943

4044
class Bs extends A {

tests/baselines/reference/thisInInvalidContexts.errors.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts(3,16): error TS2334: 'this' cannot be referenced in a static property initializer.
22
tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts(14,15): error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class.
3-
tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts(22,15): error TS2332: 'this' cannot be referenced in current location.
43
tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts(22,15): error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class.
54
tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts(28,13): error TS2331: 'this' cannot be referenced in a module or namespace body.
65
tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts(36,13): error TS2526: A 'this' type is available only in a non-static member of a class or interface.
@@ -9,7 +8,7 @@ tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts(44,9):
98
tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts(45,9): error TS2332: 'this' cannot be referenced in current location.
109

1110

12-
==== tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts (9 errors) ====
11+
==== tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts (8 errors) ====
1312
//'this' in static member initializer
1413
class ErrClass1 {
1514
static t = this; // Error
@@ -37,8 +36,6 @@ tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts(45,9):
3736
constructor() {
3837
super(this); // Error
3938
~~~~
40-
!!! error TS2332: 'this' cannot be referenced in current location.
41-
~~~~
4239
!!! error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class.
4340
}
4441
}

0 commit comments

Comments
 (0)