2014-08-15 23:33:16 +02:00
|
|
|
=== tests/cases/compiler/typeParameterCompatibilityAccrossDeclarations.ts ===
|
|
|
|
var a = {
|
|
|
|
>a : { x: <T>(y: T) => T; }
|
2014-08-22 03:39:46 +02:00
|
|
|
>{ x: function <T>(y: T): T { return null; }} : { x: <T>(y: T) => T; }
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
x: function <T>(y: T): T { return null; }
|
|
|
|
>x : <T>(y: T) => T
|
|
|
|
>function <T>(y: T): T { return null; } : <T>(y: T) => T
|
|
|
|
>T : T
|
|
|
|
>y : T
|
|
|
|
>T : T
|
|
|
|
>T : T
|
|
|
|
}
|
|
|
|
var a2 = {
|
|
|
|
>a2 : { x: (y: any) => any; }
|
2014-08-22 03:39:46 +02:00
|
|
|
>{ x: function (y: any): any { return null; }} : { x: (y: any) => any; }
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
x: function (y: any): any { return null; }
|
|
|
|
>x : (y: any) => any
|
|
|
|
>function (y: any): any { return null; } : (y: any) => any
|
|
|
|
>y : any
|
|
|
|
}
|
|
|
|
export interface I {
|
|
|
|
>I : I
|
|
|
|
|
|
|
|
x<T>(y: T): T;
|
|
|
|
>x : <T>(y: T) => T
|
|
|
|
>T : T
|
|
|
|
>y : T
|
|
|
|
>T : T
|
|
|
|
>T : T
|
|
|
|
}
|
|
|
|
export interface I2 {
|
|
|
|
>I2 : I2
|
|
|
|
|
|
|
|
x(y: any): any;
|
|
|
|
>x : (y: any) => any
|
|
|
|
>y : any
|
|
|
|
}
|
|
|
|
|
|
|
|
var i: I;
|
|
|
|
>i : I
|
|
|
|
>I : I
|
|
|
|
|
|
|
|
var i2: I2;
|
|
|
|
>i2 : I2
|
|
|
|
>I2 : I2
|
|
|
|
|
|
|
|
a = i; // error
|
|
|
|
>a = i : I
|
|
|
|
>a : { x: <T>(y: T) => T; }
|
|
|
|
>i : I
|
|
|
|
|
|
|
|
i = a; // error
|
|
|
|
>i = a : { x: <T>(y: T) => T; }
|
|
|
|
>i : I
|
|
|
|
>a : { x: <T>(y: T) => T; }
|
|
|
|
|
|
|
|
a2 = i2; // no error
|
|
|
|
>a2 = i2 : I2
|
|
|
|
>a2 : { x: (y: any) => any; }
|
|
|
|
>i2 : I2
|
|
|
|
|
|
|
|
i2 = a2; // no error
|
|
|
|
>i2 = a2 : { x: (y: any) => any; }
|
|
|
|
>i2 : I2
|
|
|
|
>a2 : { x: (y: any) => any; }
|
|
|
|
|