Skip to content

Commit 3c8ad42

Browse files
committed
Adding regression test
1 parent e354aec commit 3c8ad42

4 files changed

+105
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
//// [circularTypeofWithFunctionModule.ts]
2+
// Repro from #6072
3+
4+
class Foo {}
5+
6+
function maker (value: string): typeof maker.Bar {
7+
return maker.Bar;
8+
}
9+
10+
namespace maker {
11+
export class Bar extends Foo {}
12+
}
13+
14+
15+
//// [circularTypeofWithFunctionModule.js]
16+
// Repro from #6072
17+
var __extends = (this && this.__extends) || function (d, b) {
18+
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
19+
function __() { this.constructor = d; }
20+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
21+
};
22+
var Foo = (function () {
23+
function Foo() {
24+
}
25+
return Foo;
26+
}());
27+
function maker(value) {
28+
return maker.Bar;
29+
}
30+
var maker;
31+
(function (maker) {
32+
var Bar = (function (_super) {
33+
__extends(Bar, _super);
34+
function Bar() {
35+
_super.apply(this, arguments);
36+
}
37+
return Bar;
38+
}(Foo));
39+
maker.Bar = Bar;
40+
})(maker || (maker = {}));
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
=== tests/cases/compiler/circularTypeofWithFunctionModule.ts ===
2+
// Repro from #6072
3+
4+
class Foo {}
5+
>Foo : Symbol(Foo, Decl(circularTypeofWithFunctionModule.ts, 0, 0))
6+
7+
function maker (value: string): typeof maker.Bar {
8+
>maker : Symbol(maker, Decl(circularTypeofWithFunctionModule.ts, 2, 12), Decl(circularTypeofWithFunctionModule.ts, 6, 1))
9+
>value : Symbol(value, Decl(circularTypeofWithFunctionModule.ts, 4, 16))
10+
>maker.Bar : Symbol(maker.Bar, Decl(circularTypeofWithFunctionModule.ts, 8, 17))
11+
>maker : Symbol(maker, Decl(circularTypeofWithFunctionModule.ts, 2, 12), Decl(circularTypeofWithFunctionModule.ts, 6, 1))
12+
>Bar : Symbol(maker.Bar, Decl(circularTypeofWithFunctionModule.ts, 8, 17))
13+
14+
return maker.Bar;
15+
>maker.Bar : Symbol(maker.Bar, Decl(circularTypeofWithFunctionModule.ts, 8, 17))
16+
>maker : Symbol(maker, Decl(circularTypeofWithFunctionModule.ts, 2, 12), Decl(circularTypeofWithFunctionModule.ts, 6, 1))
17+
>Bar : Symbol(maker.Bar, Decl(circularTypeofWithFunctionModule.ts, 8, 17))
18+
}
19+
20+
namespace maker {
21+
>maker : Symbol(maker, Decl(circularTypeofWithFunctionModule.ts, 2, 12), Decl(circularTypeofWithFunctionModule.ts, 6, 1))
22+
23+
export class Bar extends Foo {}
24+
>Bar : Symbol(Bar, Decl(circularTypeofWithFunctionModule.ts, 8, 17))
25+
>Foo : Symbol(Foo, Decl(circularTypeofWithFunctionModule.ts, 0, 0))
26+
}
27+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
=== tests/cases/compiler/circularTypeofWithFunctionModule.ts ===
2+
// Repro from #6072
3+
4+
class Foo {}
5+
>Foo : Foo
6+
7+
function maker (value: string): typeof maker.Bar {
8+
>maker : typeof maker
9+
>value : string
10+
>maker.Bar : typeof maker.Bar
11+
>maker : typeof maker
12+
>Bar : typeof maker.Bar
13+
14+
return maker.Bar;
15+
>maker.Bar : typeof maker.Bar
16+
>maker : typeof maker
17+
>Bar : typeof maker.Bar
18+
}
19+
20+
namespace maker {
21+
>maker : typeof maker
22+
23+
export class Bar extends Foo {}
24+
>Bar : Bar
25+
>Foo : Foo
26+
}
27+
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Repro from #6072
2+
3+
class Foo {}
4+
5+
function maker (value: string): typeof maker.Bar {
6+
return maker.Bar;
7+
}
8+
9+
namespace maker {
10+
export class Bar extends Foo {}
11+
}

0 commit comments

Comments
 (0)