You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tests/baselines/reference/classUpdateTests.errors.txt
+12-6Lines changed: 12 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,11 @@
1
1
tests/cases/compiler/classUpdateTests.ts(34,2): error TS2377: Constructors for derived classes must contain a 'super' call.
2
2
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.
4
4
tests/cases/compiler/classUpdateTests.ts(63,7): error TS2415: Class 'L' incorrectly extends base class 'G'.
5
5
Property 'p1' is private in type 'L' but not in type 'G'.
6
6
tests/cases/compiler/classUpdateTests.ts(69,7): error TS2415: Class 'M' incorrectly extends base class 'G'.
7
7
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.
9
9
tests/cases/compiler/classUpdateTests.ts(93,3): error TS1128: Declaration or statement expected.
10
10
tests/cases/compiler/classUpdateTests.ts(95,1): error TS1128: Declaration or statement expected.
11
11
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
80
80
81
81
class K extends G {
82
82
constructor(public p1:number) { // ERROR
83
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
83
84
var i = 0;
85
+
~~~~~~~~~~~~
84
86
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
+
~~~~~~~~~~
87
88
}
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.
88
91
}
89
92
90
93
class L extends G {
@@ -101,11 +104,14 @@ tests/cases/compiler/classUpdateTests.ts(113,1): error TS1128: Declaration or st
101
104
!!! error TS2415: Class 'M' incorrectly extends base class 'G'.
102
105
!!! error TS2415: Property 'p1' is private in type 'M' but not in type 'G'.
103
106
constructor(private p1:number) { // ERROR
107
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
104
108
var i = 0;
109
+
~~~~~~~~~~~~
105
110
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
+
~~~~~~~~~~
108
112
}
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.
Copy file name to clipboardExpand all lines: tests/baselines/reference/derivedClassParameterProperties.errors.txt
+26-12Lines changed: 26 additions & 12 deletions
Original file line number
Diff line number
Diff 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.
3
3
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.
4
5
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.
5
6
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.
7
8
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.
8
9
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.
!!! error TS2376: A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.
32
+
~~~~~~~~~~~~~~~~~~~~~~~~~
32
33
}
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.
!!! error TS2376: A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.
52
+
~~~~~~~~~~~~~~~~~~~~~~~~~
49
53
}
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.
!!! error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class.
78
86
this.b = 3;
87
+
~~~~~~~~~~~~~~~~~~~
79
88
~~~~
80
89
!!! error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class.
81
90
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
+
~~~~~~~~~~~~~~~~~~~~~~~~~
84
92
}
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.
!!! error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class.
107
119
this.b = 3;
120
+
~~~~~~~~~~~~~~~~~~~
108
121
~~~~
109
122
!!! error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class.
110
123
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
+
~~~~~~~~~~~~~~~~~~~~~~~~~
113
125
}
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.
Copy file name to clipboardExpand all lines: tests/baselines/reference/derivedClassSuperCallsWithThisArg.errors.txt
+1-7Lines changed: 1 addition & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,8 @@
1
1
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.
3
2
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.
Copy file name to clipboardExpand all lines: tests/baselines/reference/strictModeInConstructor.errors.txt
+7-3Lines changed: 7 additions & 3 deletions
Original file line number
Diff line number
Diff 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.
@@ -29,12 +29,16 @@ tests/cases/compiler/strictModeInConstructor.ts(29,9): error TS2376: A 'super' c
29
29
public s: number = 9;
30
30
31
31
constructor () {
32
+
~~~~~~~~~~~~~~~~
32
33
var x = 1; // Error
34
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
33
35
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
+
~~~~~~~~~~~~~~~~
36
37
"use strict";
38
+
~~~~~~~~~~~~~~~~~~~~~
37
39
}
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.
Copy file name to clipboardExpand all lines: tests/baselines/reference/thisInInvalidContexts.errors.txt
+1-4Lines changed: 1 addition & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,5 @@
1
1
tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts(3,16): error TS2334: 'this' cannot be referenced in a static property initializer.
2
2
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.
4
3
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.
5
4
tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts(28,13): error TS2331: 'this' cannot be referenced in a module or namespace body.
6
5
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.
0 commit comments