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: src/compiler/diagnosticMessages.json
-4Lines changed: 0 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -1493,10 +1493,6 @@
1493
1493
"category": "Error",
1494
1494
"code": 2375
1495
1495
},
1496
-
"A 'super' call must be the first statement in the constructor when a class contains initialized properties, parameter properties, or private identifiers.": {
1497
-
"category": "Error",
1498
-
"code": 2376
1499
-
},
1500
1496
"Constructors for derived classes must contain a 'super' call.": {
Copy file name to clipboardExpand all lines: tests/baselines/reference/classUpdateTests.errors.txt
+1-13Lines changed: 1 addition & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,9 @@
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(57,2): error TS2376: A 'super' call must be the first statement in the constructor when a class contains initialized properties, parameter properties, or private identifiers.
4
3
tests/cases/compiler/classUpdateTests.ts(63,7): error TS2415: Class 'L' incorrectly extends base class 'G'.
5
4
Property 'p1' is private in type 'L' but not in type 'G'.
6
5
tests/cases/compiler/classUpdateTests.ts(69,7): error TS2415: Class 'M' incorrectly extends base class 'G'.
7
6
Property 'p1' is private in type 'M' but not in type 'G'.
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, parameter properties, or private identifiers.
9
7
tests/cases/compiler/classUpdateTests.ts(93,3): error TS1128: Declaration or statement expected.
10
8
tests/cases/compiler/classUpdateTests.ts(95,1): error TS1128: Declaration or statement expected.
11
9
tests/cases/compiler/classUpdateTests.ts(99,3): error TS1128: Declaration or statement expected.
@@ -80,14 +78,9 @@ tests/cases/compiler/classUpdateTests.ts(113,1): error TS1128: Declaration or st
80
78
81
79
class K extends G {
82
80
constructor(public p1:number) { // ERROR
83
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
84
81
var i = 0;
85
-
~~~~~~~~~~~~
86
82
super();
87
-
~~~~~~~~~~
88
83
}
89
-
~~
90
-
!!! error TS2376: A 'super' call must be the first statement in the constructor when a class contains initialized properties, parameter properties, or private identifiers.
91
84
}
92
85
93
86
class L extends G {
@@ -104,14 +97,9 @@ tests/cases/compiler/classUpdateTests.ts(113,1): error TS1128: Declaration or st
104
97
!!! error TS2415: Class 'M' incorrectly extends base class 'G'.
105
98
!!! error TS2415: Property 'p1' is private in type 'M' but not in type 'G'.
106
99
constructor(private p1:number) { // ERROR
107
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
108
100
var i = 0;
109
-
~~~~~~~~~~~~
110
101
super();
111
-
~~~~~~~~~~
112
102
}
113
-
~~
114
-
!!! error TS2376: A 'super' call must be the first statement in the constructor when a class contains initialized properties, parameter properties, or private identifiers.
Copy file name to clipboardExpand all lines: tests/baselines/reference/derivedClassParameterProperties.errors.txt
+1-27Lines changed: 1 addition & 27 deletions
Original file line number
Diff line number
Diff line change
@@ -1,15 +1,11 @@
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, parameter properties, or private identifiers.
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, parameter properties, or private identifiers.
3
1
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, parameter properties, or private identifiers.
5
2
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.
6
3
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.
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, parameter properties, or private identifiers.
8
4
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.
9
5
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.
!!! error TS2376: A 'super' call must be the first statement in the constructor when a class contains initialized properties, parameter properties, or private identifiers.
!!! error TS2376: A 'super' call must be the first statement in the constructor when a class contains initialized properties, parameter properties, or private identifiers.
!!! error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class.
86
70
this.b = 3;
87
-
~~~~~~~~~~~~~~~~~~~
88
71
~~~~
89
72
!!! error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class.
90
73
super(); // error
91
-
~~~~~~~~~~~~~~~~~~~~~~~~~
92
74
}
93
-
~~~~~
94
-
!!! error TS2376: A 'super' call must be the first statement in the constructor when a class contains initialized properties, parameter properties, or private identifiers.
!!! error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class.
119
97
this.b = 3;
120
-
~~~~~~~~~~~~~~~~~~~
121
98
~~~~
122
99
!!! error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class.
123
100
super(); // error
124
-
~~~~~~~~~~~~~~~~~~~~~~~~~
125
101
}
126
-
~~~~~
127
-
!!! error TS2376: A 'super' call must be the first statement in the constructor when a class contains initialized properties, parameter properties, or private identifiers.
0 commit comments