TypeScript/tests/baselines/reference/implicitAnyGenericTypeInference.js

17 lines
338 B
JavaScript
Raw Normal View History

2014-07-13 01:04:16 +02:00
//// [implicitAnyGenericTypeInference.ts]
interface Comparer<T> {
compareTo<U>(x: T, y: U): U;
}
var c: Comparer<any>;
c = { compareTo: (x, y) => { return y; } };
var r = c.compareTo(1, '');
//// [implicitAnyGenericTypeInference.js]
var c;
c = { compareTo: function (x, y) {
return y;
} };
var r = c.compareTo(1, '');