TypeScript/tests/baselines/reference/constraintPropagationThroughReturnTypes.types
2014-08-15 14:37:48 -07:00

30 lines
404 B
Plaintext

=== tests/cases/compiler/constraintPropagationThroughReturnTypes.ts ===
function g<T>(x: T): T {
>g : <T>(x: T) => T
>T : T
>x : T
>T : T
>T : T
return x;
>x : T
}
function f<S extends { foo: string }>(x: S) {
>f : <S extends { foo: string; }>(x: S) => void
>S : S
>foo : string
>x : S
>S : S
var y = g(x);
>y : S
>g(x) : S
>g : <T>(x: T) => T
>x : S
y;
>y : S
}