TypeScript/tests/baselines/reference/genericInterfaceImplementation.types

44 lines
655 B
Plaintext
Raw Normal View History

2014-08-15 23:33:16 +02:00
=== tests/cases/compiler/genericInterfaceImplementation.ts ===
interface IOption<A> {
>IOption : IOption<A>
>A : A
2014-08-15 23:33:16 +02:00
get(): A;
>get : () => A
>A : A
2014-08-15 23:33:16 +02:00
flatten<B>(): IOption<B>;
>flatten : <B>() => IOption<B>
>B : B
>IOption : IOption<A>
>B : B
2014-08-15 23:33:16 +02:00
}
class None<T> implements IOption<T>{
>None : None<T>
>T : T
>IOption : IOption<A>
>T : T
2014-08-15 23:33:16 +02:00
get(): T {
>get : () => T
>T : T
2014-08-15 23:33:16 +02:00
throw null;
2015-04-13 21:36:11 +02:00
>null : null
2014-08-15 23:33:16 +02:00
}
flatten<U>() : IOption<U> {
>flatten : <U>() => IOption<U>
>U : U
>IOption : IOption<A>
>U : U
2014-08-15 23:33:16 +02:00
return new None<U>();
>new None<U>() : None<U>
>None : typeof None
>U : U
2014-08-15 23:33:16 +02:00
}
}