Skip to content

Commit ec72ad6

Browse files
update
1 parent 7fce634 commit ec72ad6

File tree

245 files changed

+2848
-1284
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

245 files changed

+2848
-1284
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
tests/cases/conformance/classes/constructorDeclarations/superCalls/superPropertyInConstructorBeforeSuperCall.ts(7,9): error TS17011: 'super' must be called before accessing a property of 'super' in the constructor of a derived class.
2+
tests/cases/conformance/classes/constructorDeclarations/superCalls/superPropertyInConstructorBeforeSuperCall.ts(13,15): error TS17011: 'super' must be called before accessing a property of 'super' in the constructor of a derived class.
3+
4+
5+
==== tests/cases/conformance/classes/constructorDeclarations/superCalls/superPropertyInConstructorBeforeSuperCall.ts (2 errors) ====
6+
class B {
7+
constructor(x?: string) {}
8+
x(): string { return ""; }
9+
}
10+
class C1 extends B {
11+
constructor() {
12+
super.x();
13+
~~~~~
14+
!!! error TS17011: 'super' must be called before accessing a property of 'super' in the constructor of a derived class.
15+
super();
16+
}
17+
}
18+
class C2 extends B {
19+
constructor() {
20+
super(super.x());
21+
~~~~~
22+
!!! error TS17011: 'super' must be called before accessing a property of 'super' in the constructor of a derived class.
23+
}
24+
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
//// [superPropertyInConstructorBeforeSuperCall.ts]
2+
class B {
3+
constructor(x?: string) {}
4+
x(): string { return ""; }
5+
}
6+
class C1 extends B {
7+
constructor() {
8+
super.x();
9+
super();
10+
}
11+
}
12+
class C2 extends B {
13+
constructor() {
14+
super(super.x());
15+
}
16+
}
17+
18+
//// [superPropertyInConstructorBeforeSuperCall.js]
19+
var __extends = (this && this.__extends) || function (d, b) {
20+
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
21+
function __() { this.constructor = d; }
22+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
23+
};
24+
var B = (function () {
25+
function B(x) {
26+
}
27+
B.prototype.x = function () { return ""; };
28+
return B;
29+
}());
30+
var C1 = (function (_super) {
31+
__extends(C1, _super);
32+
function C1() {
33+
var _this;
34+
_super.prototype.x.call(_this);
35+
_this = _super.call(this) || this;
36+
return _this;
37+
}
38+
return C1;
39+
}(B));
40+
var C2 = (function (_super) {
41+
__extends(C2, _super);
42+
function C2() {
43+
return _super.call(this, _super.x.call(_this)) || this;
44+
}
45+
return C2;
46+
}(B));

tests/baselines/reference/superWithTypeArgument.errors.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
tests/cases/compiler/superWithTypeArgument.ts(6,5): error TS2377: Constructors for derived classes must contain a 'super' call.
2+
tests/cases/compiler/superWithTypeArgument.ts(7,9): error TS17011: 'super' must be called before accessing a property of 'super' in the constructor of a derived class.
23
tests/cases/compiler/superWithTypeArgument.ts(7,14): error TS1034: 'super' must be followed by an argument list or member access.
34

45

5-
==== tests/cases/compiler/superWithTypeArgument.ts (2 errors) ====
6+
==== tests/cases/compiler/superWithTypeArgument.ts (3 errors) ====
67
class C {
78

89
}
@@ -12,6 +13,8 @@ tests/cases/compiler/superWithTypeArgument.ts(7,14): error TS1034: 'super' must
1213
~~~~~~~~~~~~~~~
1314
super<T>();
1415
~~~~~~~~~~~~~~~~~~~
16+
~~~~~
17+
!!! error TS17011: 'super' must be called before accessing a property of 'super' in the constructor of a derived class.
1518
~
1619
!!! error TS1034: 'super' must be followed by an argument list or member access.
1720
}

tests/baselines/reference/superWithTypeArgument2.errors.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
tests/cases/compiler/superWithTypeArgument2.ts(6,5): error TS2377: Constructors for derived classes must contain a 'super' call.
2+
tests/cases/compiler/superWithTypeArgument2.ts(7,9): error TS17011: 'super' must be called before accessing a property of 'super' in the constructor of a derived class.
23
tests/cases/compiler/superWithTypeArgument2.ts(7,14): error TS1034: 'super' must be followed by an argument list or member access.
34

45

5-
==== tests/cases/compiler/superWithTypeArgument2.ts (2 errors) ====
6+
==== tests/cases/compiler/superWithTypeArgument2.ts (3 errors) ====
67
class C<T> {
78
foo: T;
89
}
@@ -12,6 +13,8 @@ tests/cases/compiler/superWithTypeArgument2.ts(7,14): error TS1034: 'super' must
1213
~~~~~~~~~~~~~~~~
1314
super<T>(x);
1415
~~~~~~~~~~~~~~~~~~~~
16+
~~~~~
17+
!!! error TS17011: 'super' must be called before accessing a property of 'super' in the constructor of a derived class.
1518
~
1619
!!! error TS1034: 'super' must be followed by an argument list or member access.
1720
}

tests/baselines/reference/superWithTypeArgument3.errors.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
tests/cases/compiler/superWithTypeArgument3.ts(7,5): error TS2377: Constructors for derived classes must contain a 'super' call.
2+
tests/cases/compiler/superWithTypeArgument3.ts(8,9): error TS17011: 'super' must be called before accessing a property of 'super' in the constructor of a derived class.
23
tests/cases/compiler/superWithTypeArgument3.ts(8,14): error TS1034: 'super' must be followed by an argument list or member access.
34

45

5-
==== tests/cases/compiler/superWithTypeArgument3.ts (2 errors) ====
6+
==== tests/cases/compiler/superWithTypeArgument3.ts (3 errors) ====
67
class C<T> {
78
foo: T;
89
bar<U>(x: U) { }
@@ -13,6 +14,8 @@ tests/cases/compiler/superWithTypeArgument3.ts(8,14): error TS1034: 'super' must
1314
~~~~~~~~~~~~~~~
1415
super<T>();
1516
~~~~~~~~~~~~~~~~~~~
17+
~~~~~
18+
!!! error TS17011: 'super' must be called before accessing a property of 'super' in the constructor of a derived class.
1619
~
1720
!!! error TS1034: 'super' must be followed by an argument list or member access.
1821
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//// [systemModuleTrailingComments.ts]
2+
export const test = "TEST";
3+
4+
//some comment
5+
6+
//// [systemModuleTrailingComments.js]
7+
System.register([], function (exports_1, context_1) {
8+
"use strict";
9+
var __moduleName = context_1 && context_1.id;
10+
var test;
11+
return {
12+
setters: [],
13+
execute: function () {
14+
exports_1("test", test = "TEST");
15+
//some comment
16+
}
17+
};
18+
});
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
=== tests/cases/compiler/systemModuleTrailingComments.ts ===
2+
export const test = "TEST";
3+
>test : Symbol(test, Decl(systemModuleTrailingComments.ts, 0, 12))
4+
5+
//some comment
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
=== tests/cases/compiler/systemModuleTrailingComments.ts ===
2+
export const test = "TEST";
3+
>test : "TEST"
4+
>"TEST" : "TEST"
5+
6+
//some comment
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//// [unionTypeWithLeadingOperator.ts]
2+
type A = | string;
3+
type B =
4+
| { type: "INCREMENT" }
5+
| { type: "DECREMENT" };
6+
7+
type C = [| 0 | 1, | "foo" | "bar"];
8+
9+
10+
//// [unionTypeWithLeadingOperator.js]
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
=== tests/cases/compiler/unionTypeWithLeadingOperator.ts ===
2+
type A = | string;
3+
>A : Symbol(A, Decl(unionTypeWithLeadingOperator.ts, 0, 0))
4+
5+
type B =
6+
>B : Symbol(B, Decl(unionTypeWithLeadingOperator.ts, 0, 18))
7+
8+
| { type: "INCREMENT" }
9+
>type : Symbol(type, Decl(unionTypeWithLeadingOperator.ts, 2, 5))
10+
11+
| { type: "DECREMENT" };
12+
>type : Symbol(type, Decl(unionTypeWithLeadingOperator.ts, 3, 5))
13+
14+
type C = [| 0 | 1, | "foo" | "bar"];
15+
>C : Symbol(C, Decl(unionTypeWithLeadingOperator.ts, 3, 26))
16+

0 commit comments

Comments
 (0)