TypeScript/tests/cases/compiler/genericInterfaceImplementation.ts

16 lines
235 B
TypeScript
Raw Normal View History

2014-07-13 01:04:16 +02:00
interface IOption<A> {
get(): A;
flatten<B>(): IOption<B>;
}
class None<T> implements IOption<T>{
get(): T {
throw null;
}
flatten<U>() : IOption<U> {
return new None<U>();
}
}