TypeScript/tests/cases/compiler/icomparable.ts

12 lines
261 B
TypeScript
Raw Normal View History

2014-07-13 01:04:16 +02:00
interface IComparable<T> {
compareTo(other: T);
}
declare function sort<U extends IComparable<any>>(items: U[]): U[];
interface StringComparable extends IComparable<string> {
}
var sc: StringComparable[];
var x = sort(sc);