19 lines
298 B
JavaScript
19 lines
298 B
JavaScript
//// [constraintPropagationThroughReturnTypes.ts]
|
|
function g<T>(x: T): T {
|
|
return x;
|
|
}
|
|
|
|
function f<S extends { foo: string }>(x: S) {
|
|
var y = g(x);
|
|
y;
|
|
}
|
|
|
|
|
|
//// [constraintPropagationThroughReturnTypes.js]
|
|
function g(x) {
|
|
return x;
|
|
}
|
|
function f(x) {
|
|
var y = g(x);
|
|
y;
|
|
}
|