TypeScript/tests/baselines/reference/genericInterfaceImplementation.types
2015-04-15 16:44:20 -07:00

44 lines
655 B
Plaintext

=== tests/cases/compiler/genericInterfaceImplementation.ts ===
interface IOption<A> {
>IOption : IOption<A>
>A : A
get(): A;
>get : () => A
>A : A
flatten<B>(): IOption<B>;
>flatten : <B>() => IOption<B>
>B : B
>IOption : IOption<A>
>B : B
}
class None<T> implements IOption<T>{
>None : None<T>
>T : T
>IOption : IOption<A>
>T : T
get(): T {
>get : () => T
>T : T
throw null;
>null : null
}
flatten<U>() : IOption<U> {
>flatten : <U>() => IOption<U>
>U : U
>IOption : IOption<A>
>U : U
return new None<U>();
>new None<U>() : None<U>
>None : typeof None
>U : U
}
}