Skip to content

Commit 6f42ecd

Browse files
committed
Accept new baselines
1 parent 2f4c8eb commit 6f42ecd

3 files changed

Lines changed: 91 additions & 0 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//// [unionSignaturesWithThisParameter.ts]
2+
// Repro from #20802
3+
4+
function x<T>(ctor: {
5+
(this: {}, v: T): void;
6+
new(v: T): void;
7+
} | {
8+
(v: T): void;
9+
new(v: T): void;
10+
}, t: T) {
11+
new ctor(t);
12+
}
13+
14+
15+
//// [unionSignaturesWithThisParameter.js]
16+
"use strict";
17+
// Repro from #20802
18+
function x(ctor, t) {
19+
new ctor(t);
20+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
=== tests/cases/compiler/unionSignaturesWithThisParameter.ts ===
2+
// Repro from #20802
3+
4+
function x<T>(ctor: {
5+
>x : Symbol(x, Decl(unionSignaturesWithThisParameter.ts, 0, 0))
6+
>T : Symbol(T, Decl(unionSignaturesWithThisParameter.ts, 2, 11))
7+
>ctor : Symbol(ctor, Decl(unionSignaturesWithThisParameter.ts, 2, 14))
8+
9+
(this: {}, v: T): void;
10+
>this : Symbol(this, Decl(unionSignaturesWithThisParameter.ts, 3, 5))
11+
>v : Symbol(v, Decl(unionSignaturesWithThisParameter.ts, 3, 14))
12+
>T : Symbol(T, Decl(unionSignaturesWithThisParameter.ts, 2, 11))
13+
14+
new(v: T): void;
15+
>v : Symbol(v, Decl(unionSignaturesWithThisParameter.ts, 4, 8))
16+
>T : Symbol(T, Decl(unionSignaturesWithThisParameter.ts, 2, 11))
17+
18+
} | {
19+
(v: T): void;
20+
>v : Symbol(v, Decl(unionSignaturesWithThisParameter.ts, 6, 5))
21+
>T : Symbol(T, Decl(unionSignaturesWithThisParameter.ts, 2, 11))
22+
23+
new(v: T): void;
24+
>v : Symbol(v, Decl(unionSignaturesWithThisParameter.ts, 7, 8))
25+
>T : Symbol(T, Decl(unionSignaturesWithThisParameter.ts, 2, 11))
26+
27+
}, t: T) {
28+
>t : Symbol(t, Decl(unionSignaturesWithThisParameter.ts, 8, 2))
29+
>T : Symbol(T, Decl(unionSignaturesWithThisParameter.ts, 2, 11))
30+
31+
new ctor(t);
32+
>ctor : Symbol(ctor, Decl(unionSignaturesWithThisParameter.ts, 2, 14))
33+
>t : Symbol(t, Decl(unionSignaturesWithThisParameter.ts, 8, 2))
34+
}
35+
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
=== tests/cases/compiler/unionSignaturesWithThisParameter.ts ===
2+
// Repro from #20802
3+
4+
function x<T>(ctor: {
5+
>x : <T>(ctor: { (this: {}, v: T): void; new (v: T): void; } | { (v: T): void; new (v: T): void; }, t: T) => void
6+
>T : T
7+
>ctor : { (this: {}, v: T): void; new (v: T): void; } | { (v: T): void; new (v: T): void; }
8+
9+
(this: {}, v: T): void;
10+
>this : {}
11+
>v : T
12+
>T : T
13+
14+
new(v: T): void;
15+
>v : T
16+
>T : T
17+
18+
} | {
19+
(v: T): void;
20+
>v : T
21+
>T : T
22+
23+
new(v: T): void;
24+
>v : T
25+
>T : T
26+
27+
}, t: T) {
28+
>t : T
29+
>T : T
30+
31+
new ctor(t);
32+
>new ctor(t) : void
33+
>ctor : { (this: {}, v: T): void; new (v: T): void; } | { (v: T): void; new (v: T): void; }
34+
>t : T
35+
}
36+

0 commit comments

Comments
 (0)