TypeScript/tests/baselines/reference/genericCallSpecializedToTypeArg.js
2014-08-15 15:49:09 -07:00

21 lines
542 B
TypeScript

//// [genericCallSpecializedToTypeArg.ts]
function dupe<T>(x: T): T {
return x;
}
function dupeAndGetDist<U>(x: U): U {
var y = dupe(x); //<-- dupe has incorrect type here
y.getDist(); //<-- this requires a missing constraint, but it's not caught
return y;
}
//// [genericCallSpecializedToTypeArg.js]
function dupe(x) {
return x;
}
function dupeAndGetDist(x) {
var y = dupe(x); //<-- dupe has incorrect type here
y.getDist(); //<-- this requires a missing constraint, but it's not caught
return y;
}