2014-08-15 23:33:16 +02:00
|
|
|
=== tests/cases/compiler/extendedInterfaceGenericType.ts ===
|
|
|
|
interface Alpha<T> {
|
|
|
|
>Alpha : Alpha<T>
|
|
|
|
>T : T
|
|
|
|
|
|
|
|
takesArgOfT(arg: T): Alpha<T>;
|
|
|
|
>takesArgOfT : (arg: T) => Alpha<T>
|
|
|
|
>arg : T
|
|
|
|
>T : T
|
2014-08-19 04:56:03 +02:00
|
|
|
>Alpha : Alpha<T>
|
2014-08-15 23:33:16 +02:00
|
|
|
>T : T
|
|
|
|
|
|
|
|
makeBetaOfNumber(): Beta<number>;
|
|
|
|
>makeBetaOfNumber : () => Beta<number>
|
2014-08-19 04:56:03 +02:00
|
|
|
>Beta : Beta<T>
|
2014-08-15 23:33:16 +02:00
|
|
|
}
|
|
|
|
interface Beta<T> extends Alpha<T> {
|
|
|
|
>Beta : Beta<T>
|
|
|
|
>T : T
|
2014-08-19 04:56:03 +02:00
|
|
|
>Alpha : Alpha<T>
|
2014-08-15 23:33:16 +02:00
|
|
|
>T : T
|
|
|
|
}
|
|
|
|
|
|
|
|
var alpha: Alpha<number>;
|
|
|
|
>alpha : Alpha<number>
|
2014-08-19 04:56:03 +02:00
|
|
|
>Alpha : Alpha<T>
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
var betaOfNumber = alpha.makeBetaOfNumber();
|
|
|
|
>betaOfNumber : Beta<number>
|
|
|
|
>alpha.makeBetaOfNumber() : Beta<number>
|
|
|
|
>alpha.makeBetaOfNumber : () => Beta<number>
|
|
|
|
>alpha : Alpha<number>
|
|
|
|
>makeBetaOfNumber : () => Beta<number>
|
|
|
|
|
|
|
|
betaOfNumber.takesArgOfT(5);
|
|
|
|
>betaOfNumber.takesArgOfT(5) : Alpha<number>
|
|
|
|
>betaOfNumber.takesArgOfT : (arg: number) => Alpha<number>
|
|
|
|
>betaOfNumber : Beta<number>
|
|
|
|
>takesArgOfT : (arg: number) => Alpha<number>
|
|
|
|
|