TypeScript/tests/cases/compiler/unionTypeParameterInference.ts
2015-12-02 15:41:37 -08:00

10 lines
198 B
TypeScript

// 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;
}