Skip to content

Commit 3e6d40f

Browse files
committed
Removing comment from test
1 parent 561360d commit 3e6d40f

4 files changed

Lines changed: 33 additions & 24 deletions

File tree

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
//// [unionTypeParameterInference.ts]
2+
// Regression test for #5861
3+
24
interface Foo<T> { prop: T; }
35

46
declare function lift<U>(value: U | Foo<U>): Foo<U>;
57

68
function unlift<U>(value: U | Foo<U>): U {
7-
return lift(value).prop; // error TS2322: Type '{}' is not assignable to type 'U'.
9+
return lift(value).prop;
810
}
911

1012

1113
//// [unionTypeParameterInference.js]
14+
// Regression test for #5861
1215
function unlift(value) {
13-
return lift(value).prop; // error TS2322: Type '{}' is not assignable to type 'U'.
16+
return lift(value).prop;
1417
}
Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,35 @@
11
=== tests/cases/compiler/unionTypeParameterInference.ts ===
2+
// Regression test for #5861
3+
24
interface Foo<T> { prop: T; }
35
>Foo : Symbol(Foo, Decl(unionTypeParameterInference.ts, 0, 0))
4-
>T : Symbol(T, Decl(unionTypeParameterInference.ts, 0, 14))
5-
>prop : Symbol(prop, Decl(unionTypeParameterInference.ts, 0, 18))
6-
>T : Symbol(T, Decl(unionTypeParameterInference.ts, 0, 14))
6+
>T : Symbol(T, Decl(unionTypeParameterInference.ts, 2, 14))
7+
>prop : Symbol(prop, Decl(unionTypeParameterInference.ts, 2, 18))
8+
>T : Symbol(T, Decl(unionTypeParameterInference.ts, 2, 14))
79

810
declare function lift<U>(value: U | Foo<U>): Foo<U>;
9-
>lift : Symbol(lift, Decl(unionTypeParameterInference.ts, 0, 29))
10-
>U : Symbol(U, Decl(unionTypeParameterInference.ts, 2, 22))
11-
>value : Symbol(value, Decl(unionTypeParameterInference.ts, 2, 25))
12-
>U : Symbol(U, Decl(unionTypeParameterInference.ts, 2, 22))
11+
>lift : Symbol(lift, Decl(unionTypeParameterInference.ts, 2, 29))
12+
>U : Symbol(U, Decl(unionTypeParameterInference.ts, 4, 22))
13+
>value : Symbol(value, Decl(unionTypeParameterInference.ts, 4, 25))
14+
>U : Symbol(U, Decl(unionTypeParameterInference.ts, 4, 22))
1315
>Foo : Symbol(Foo, Decl(unionTypeParameterInference.ts, 0, 0))
14-
>U : Symbol(U, Decl(unionTypeParameterInference.ts, 2, 22))
16+
>U : Symbol(U, Decl(unionTypeParameterInference.ts, 4, 22))
1517
>Foo : Symbol(Foo, Decl(unionTypeParameterInference.ts, 0, 0))
16-
>U : Symbol(U, Decl(unionTypeParameterInference.ts, 2, 22))
18+
>U : Symbol(U, Decl(unionTypeParameterInference.ts, 4, 22))
1719

1820
function unlift<U>(value: U | Foo<U>): U {
19-
>unlift : Symbol(unlift, Decl(unionTypeParameterInference.ts, 2, 52))
20-
>U : Symbol(U, Decl(unionTypeParameterInference.ts, 4, 16))
21-
>value : Symbol(value, Decl(unionTypeParameterInference.ts, 4, 19))
22-
>U : Symbol(U, Decl(unionTypeParameterInference.ts, 4, 16))
21+
>unlift : Symbol(unlift, Decl(unionTypeParameterInference.ts, 4, 52))
22+
>U : Symbol(U, Decl(unionTypeParameterInference.ts, 6, 16))
23+
>value : Symbol(value, Decl(unionTypeParameterInference.ts, 6, 19))
24+
>U : Symbol(U, Decl(unionTypeParameterInference.ts, 6, 16))
2325
>Foo : Symbol(Foo, Decl(unionTypeParameterInference.ts, 0, 0))
24-
>U : Symbol(U, Decl(unionTypeParameterInference.ts, 4, 16))
25-
>U : Symbol(U, Decl(unionTypeParameterInference.ts, 4, 16))
26+
>U : Symbol(U, Decl(unionTypeParameterInference.ts, 6, 16))
27+
>U : Symbol(U, Decl(unionTypeParameterInference.ts, 6, 16))
2628

27-
return lift(value).prop; // error TS2322: Type '{}' is not assignable to type 'U'.
28-
>lift(value).prop : Symbol(Foo.prop, Decl(unionTypeParameterInference.ts, 0, 18))
29-
>lift : Symbol(lift, Decl(unionTypeParameterInference.ts, 0, 29))
30-
>value : Symbol(value, Decl(unionTypeParameterInference.ts, 4, 19))
31-
>prop : Symbol(Foo.prop, Decl(unionTypeParameterInference.ts, 0, 18))
29+
return lift(value).prop;
30+
>lift(value).prop : Symbol(Foo.prop, Decl(unionTypeParameterInference.ts, 2, 18))
31+
>lift : Symbol(lift, Decl(unionTypeParameterInference.ts, 2, 29))
32+
>value : Symbol(value, Decl(unionTypeParameterInference.ts, 6, 19))
33+
>prop : Symbol(Foo.prop, Decl(unionTypeParameterInference.ts, 2, 18))
3234
}
3335

tests/baselines/reference/unionTypeParameterInference.types

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
=== tests/cases/compiler/unionTypeParameterInference.ts ===
2+
// Regression test for #5861
3+
24
interface Foo<T> { prop: T; }
35
>Foo : Foo<T>
46
>T : T
@@ -24,7 +26,7 @@ function unlift<U>(value: U | Foo<U>): U {
2426
>U : U
2527
>U : U
2628

27-
return lift(value).prop; // error TS2322: Type '{}' is not assignable to type 'U'.
29+
return lift(value).prop;
2830
>lift(value).prop : U
2931
>lift(value) : Foo<U>
3032
>lift : <U>(value: U | Foo<U>) => Foo<U>
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
// Regression test for #5861
2+
13
interface Foo<T> { prop: T; }
24

35
declare function lift<U>(value: U | Foo<U>): Foo<U>;
46

57
function unlift<U>(value: U | Foo<U>): U {
6-
return lift(value).prop; // error TS2322: Type '{}' is not assignable to type 'U'.
8+
return lift(value).prop;
79
}

0 commit comments

Comments
 (0)