Skip to content

Commit 75c143b

Browse files
committed
Add testcase for #4341
1 parent 25dfcec commit 75c143b

File tree

4 files changed

+88
-0
lines changed

4 files changed

+88
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
//// [baseClassOutOfOrder.ts]
2+
class B extends A {
3+
constructor(msg: string) {
4+
super(msg);
5+
}
6+
}
7+
8+
class A {
9+
constructor(public msg: string) {
10+
11+
}
12+
}
13+
14+
//// [baseClassOutOfOrder.js]
15+
var __extends = (this && this.__extends) || function (d, b) {
16+
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
17+
function __() { this.constructor = d; }
18+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
19+
};
20+
var B = (function (_super) {
21+
__extends(B, _super);
22+
function B(msg) {
23+
_super.call(this, msg);
24+
}
25+
return B;
26+
})(A);
27+
var A = (function () {
28+
function A(msg) {
29+
this.msg = msg;
30+
}
31+
return A;
32+
})();
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
=== tests/cases/compiler/baseClassOutOfOrder.ts ===
2+
class B extends A {
3+
>B : Symbol(B, Decl(baseClassOutOfOrder.ts, 0, 0))
4+
>A : Symbol(A, Decl(baseClassOutOfOrder.ts, 4, 1))
5+
6+
constructor(msg: string) {
7+
>msg : Symbol(msg, Decl(baseClassOutOfOrder.ts, 1, 16))
8+
9+
super(msg);
10+
>super : Symbol(A, Decl(baseClassOutOfOrder.ts, 4, 1))
11+
>msg : Symbol(msg, Decl(baseClassOutOfOrder.ts, 1, 16))
12+
}
13+
}
14+
15+
class A {
16+
>A : Symbol(A, Decl(baseClassOutOfOrder.ts, 4, 1))
17+
18+
constructor(public msg: string) {
19+
>msg : Symbol(msg, Decl(baseClassOutOfOrder.ts, 7, 16))
20+
21+
}
22+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
=== tests/cases/compiler/baseClassOutOfOrder.ts ===
2+
class B extends A {
3+
>B : B
4+
>A : A
5+
6+
constructor(msg: string) {
7+
>msg : string
8+
9+
super(msg);
10+
>super(msg) : void
11+
>super : typeof A
12+
>msg : string
13+
}
14+
}
15+
16+
class A {
17+
>A : A
18+
19+
constructor(public msg: string) {
20+
>msg : string
21+
22+
}
23+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
class B extends A {
2+
constructor(msg: string) {
3+
super(msg);
4+
}
5+
}
6+
7+
class A {
8+
constructor(public msg: string) {
9+
10+
}
11+
}

0 commit comments

Comments
 (0)