mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-11 01:34:55 -06:00
Removing comment from test
This commit is contained in:
parent
561360d550
commit
3e6d40f3fe
@ -1,14 +1,17 @@
|
||||
//// [unionTypeParameterInference.ts]
|
||||
// Regression test for #5861
|
||||
|
||||
interface Foo<T> { prop: T; }
|
||||
|
||||
declare function lift<U>(value: U | Foo<U>): Foo<U>;
|
||||
|
||||
function unlift<U>(value: U | Foo<U>): U {
|
||||
return lift(value).prop; // error TS2322: Type '{}' is not assignable to type 'U'.
|
||||
return lift(value).prop;
|
||||
}
|
||||
|
||||
|
||||
//// [unionTypeParameterInference.js]
|
||||
// Regression test for #5861
|
||||
function unlift(value) {
|
||||
return lift(value).prop; // error TS2322: Type '{}' is not assignable to type 'U'.
|
||||
return lift(value).prop;
|
||||
}
|
||||
|
||||
@ -1,33 +1,35 @@
|
||||
=== tests/cases/compiler/unionTypeParameterInference.ts ===
|
||||
// Regression test for #5861
|
||||
|
||||
interface Foo<T> { prop: T; }
|
||||
>Foo : Symbol(Foo, Decl(unionTypeParameterInference.ts, 0, 0))
|
||||
>T : Symbol(T, Decl(unionTypeParameterInference.ts, 0, 14))
|
||||
>prop : Symbol(prop, Decl(unionTypeParameterInference.ts, 0, 18))
|
||||
>T : Symbol(T, Decl(unionTypeParameterInference.ts, 0, 14))
|
||||
>T : Symbol(T, Decl(unionTypeParameterInference.ts, 2, 14))
|
||||
>prop : Symbol(prop, Decl(unionTypeParameterInference.ts, 2, 18))
|
||||
>T : Symbol(T, Decl(unionTypeParameterInference.ts, 2, 14))
|
||||
|
||||
declare function lift<U>(value: U | Foo<U>): Foo<U>;
|
||||
>lift : Symbol(lift, Decl(unionTypeParameterInference.ts, 0, 29))
|
||||
>U : Symbol(U, Decl(unionTypeParameterInference.ts, 2, 22))
|
||||
>value : Symbol(value, Decl(unionTypeParameterInference.ts, 2, 25))
|
||||
>U : Symbol(U, Decl(unionTypeParameterInference.ts, 2, 22))
|
||||
>lift : Symbol(lift, Decl(unionTypeParameterInference.ts, 2, 29))
|
||||
>U : Symbol(U, Decl(unionTypeParameterInference.ts, 4, 22))
|
||||
>value : Symbol(value, Decl(unionTypeParameterInference.ts, 4, 25))
|
||||
>U : Symbol(U, Decl(unionTypeParameterInference.ts, 4, 22))
|
||||
>Foo : Symbol(Foo, Decl(unionTypeParameterInference.ts, 0, 0))
|
||||
>U : Symbol(U, Decl(unionTypeParameterInference.ts, 2, 22))
|
||||
>U : Symbol(U, Decl(unionTypeParameterInference.ts, 4, 22))
|
||||
>Foo : Symbol(Foo, Decl(unionTypeParameterInference.ts, 0, 0))
|
||||
>U : Symbol(U, Decl(unionTypeParameterInference.ts, 2, 22))
|
||||
>U : Symbol(U, Decl(unionTypeParameterInference.ts, 4, 22))
|
||||
|
||||
function unlift<U>(value: U | Foo<U>): U {
|
||||
>unlift : Symbol(unlift, Decl(unionTypeParameterInference.ts, 2, 52))
|
||||
>U : Symbol(U, Decl(unionTypeParameterInference.ts, 4, 16))
|
||||
>value : Symbol(value, Decl(unionTypeParameterInference.ts, 4, 19))
|
||||
>U : Symbol(U, Decl(unionTypeParameterInference.ts, 4, 16))
|
||||
>unlift : Symbol(unlift, Decl(unionTypeParameterInference.ts, 4, 52))
|
||||
>U : Symbol(U, Decl(unionTypeParameterInference.ts, 6, 16))
|
||||
>value : Symbol(value, Decl(unionTypeParameterInference.ts, 6, 19))
|
||||
>U : Symbol(U, Decl(unionTypeParameterInference.ts, 6, 16))
|
||||
>Foo : Symbol(Foo, Decl(unionTypeParameterInference.ts, 0, 0))
|
||||
>U : Symbol(U, Decl(unionTypeParameterInference.ts, 4, 16))
|
||||
>U : Symbol(U, Decl(unionTypeParameterInference.ts, 4, 16))
|
||||
>U : Symbol(U, Decl(unionTypeParameterInference.ts, 6, 16))
|
||||
>U : Symbol(U, Decl(unionTypeParameterInference.ts, 6, 16))
|
||||
|
||||
return lift(value).prop; // error TS2322: Type '{}' is not assignable to type 'U'.
|
||||
>lift(value).prop : Symbol(Foo.prop, Decl(unionTypeParameterInference.ts, 0, 18))
|
||||
>lift : Symbol(lift, Decl(unionTypeParameterInference.ts, 0, 29))
|
||||
>value : Symbol(value, Decl(unionTypeParameterInference.ts, 4, 19))
|
||||
>prop : Symbol(Foo.prop, Decl(unionTypeParameterInference.ts, 0, 18))
|
||||
return lift(value).prop;
|
||||
>lift(value).prop : Symbol(Foo.prop, Decl(unionTypeParameterInference.ts, 2, 18))
|
||||
>lift : Symbol(lift, Decl(unionTypeParameterInference.ts, 2, 29))
|
||||
>value : Symbol(value, Decl(unionTypeParameterInference.ts, 6, 19))
|
||||
>prop : Symbol(Foo.prop, Decl(unionTypeParameterInference.ts, 2, 18))
|
||||
}
|
||||
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
=== tests/cases/compiler/unionTypeParameterInference.ts ===
|
||||
// Regression test for #5861
|
||||
|
||||
interface Foo<T> { prop: T; }
|
||||
>Foo : Foo<T>
|
||||
>T : T
|
||||
@ -24,7 +26,7 @@ function unlift<U>(value: U | Foo<U>): U {
|
||||
>U : U
|
||||
>U : U
|
||||
|
||||
return lift(value).prop; // error TS2322: Type '{}' is not assignable to type 'U'.
|
||||
return lift(value).prop;
|
||||
>lift(value).prop : U
|
||||
>lift(value) : Foo<U>
|
||||
>lift : <U>(value: U | Foo<U>) => Foo<U>
|
||||
|
||||
@ -1,7 +1,9 @@
|
||||
// Regression test for #5861
|
||||
|
||||
interface Foo<T> { prop: T; }
|
||||
|
||||
declare function lift<U>(value: U | Foo<U>): Foo<U>;
|
||||
|
||||
function unlift<U>(value: U | Foo<U>): U {
|
||||
return lift(value).prop; // error TS2322: Type '{}' is not assignable to type 'U'.
|
||||
return lift(value).prop;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user