2014-08-15 23:33:16 +02:00
|
|
|
=== tests/cases/compiler/inheritedGenericCallSignature.ts ===
|
|
|
|
|
|
|
|
interface I1<T> {
|
|
|
|
>I1 : I1<T>
|
|
|
|
>T : T
|
|
|
|
|
|
|
|
(a: T): T;
|
|
|
|
>a : T
|
|
|
|
>T : T
|
|
|
|
>T : T
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
interface Object {}
|
|
|
|
>Object : Object
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
interface I2<T> extends I1<T[]> {
|
|
|
|
>I2 : I2<T>
|
|
|
|
>T : T
|
2014-08-19 04:56:03 +02:00
|
|
|
>I1 : I1<T>
|
2014-08-15 23:33:16 +02:00
|
|
|
>T : T
|
|
|
|
|
|
|
|
b: T;
|
|
|
|
>b : T
|
|
|
|
>T : T
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var x: I2<Date>;
|
|
|
|
>x : I2<Date>
|
2014-08-19 04:56:03 +02:00
|
|
|
>I2 : I2<T>
|
2014-08-15 23:33:16 +02:00
|
|
|
>Date : Date
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var y = x(undefined);
|
|
|
|
>y : Date[]
|
|
|
|
>x(undefined) : Date[]
|
|
|
|
>x : I2<Date>
|
|
|
|
>undefined : undefined
|
|
|
|
|
|
|
|
y.length; // should not error
|
|
|
|
>y.length : number
|
|
|
|
>y : Date[]
|
|
|
|
>length : number
|
|
|
|
|