29 lines
404 B
Text
29 lines
404 B
Text
=== 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
|
|
}
|
|
|