TypeScript/tests/cases/compiler/genericInterfaceImplementation.ts
2014-07-12 17:30:19 -07:00

16 lines
235 B
TypeScript

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>();
}
}