TypeScript/tests/baselines/reference/genericCallSpecializedToTypeArg.js

21 lines
542 B
TypeScript
Raw Normal View History

2014-07-13 01:04:16 +02:00
//// [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
2014-07-13 01:04:16 +02:00
return y;
}