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) {
|
2014-08-15 01:36:33 +02:00
|
|
|
var y = dupe(x); //<-- dupe has incorrect type here
|
2014-07-13 01:04:16 +02:00
|
|
|
y.getDist();
|
|
|
|
return y;
|
|
|
|
}
|