2014-08-15 23:33:16 +02:00
|
|
|
=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures3.ts ===
|
|
|
|
// these are all permitted with the current rules, since we do not do contextual signature instantiation
|
|
|
|
|
|
|
|
class Base { foo: string; }
|
|
|
|
>Base : Base
|
|
|
|
>foo : string
|
|
|
|
|
|
|
|
class Derived extends Base { bar: string; }
|
|
|
|
>Derived : Derived
|
|
|
|
>Base : Base
|
|
|
|
>bar : string
|
|
|
|
|
|
|
|
class Derived2 extends Derived { baz: string; }
|
|
|
|
>Derived2 : Derived2
|
|
|
|
>Derived : Derived
|
|
|
|
>baz : string
|
|
|
|
|
|
|
|
class OtherDerived extends Base { bing: string; }
|
|
|
|
>OtherDerived : OtherDerived
|
|
|
|
>Base : Base
|
|
|
|
>bing : string
|
|
|
|
|
|
|
|
var a: (x: number) => number[];
|
|
|
|
>a : (x: number) => number[]
|
|
|
|
>x : number
|
|
|
|
|
|
|
|
var a2: (x: number) => string[];
|
|
|
|
>a2 : (x: number) => string[]
|
|
|
|
>x : number
|
|
|
|
|
|
|
|
var a3: (x: number) => void;
|
|
|
|
>a3 : (x: number) => void
|
|
|
|
>x : number
|
|
|
|
|
|
|
|
var a4: (x: string, y: number) => string;
|
|
|
|
>a4 : (x: string, y: number) => string
|
|
|
|
>x : string
|
|
|
|
>y : number
|
|
|
|
|
|
|
|
var a5: (x: (arg: string) => number) => string;
|
|
|
|
>a5 : (x: (arg: string) => number) => string
|
|
|
|
>x : (arg: string) => number
|
|
|
|
>arg : string
|
|
|
|
|
|
|
|
var a6: (x: (arg: Base) => Derived) => Base;
|
|
|
|
>a6 : (x: (arg: Base) => Derived) => Base
|
|
|
|
>x : (arg: Base) => Derived
|
|
|
|
>arg : Base
|
|
|
|
>Base : Base
|
|
|
|
>Derived : Derived
|
|
|
|
>Base : Base
|
|
|
|
|
|
|
|
var a7: (x: (arg: Base) => Derived) => (r: Base) => Derived;
|
|
|
|
>a7 : (x: (arg: Base) => Derived) => (r: Base) => Derived
|
|
|
|
>x : (arg: Base) => Derived
|
|
|
|
>arg : Base
|
|
|
|
>Base : Base
|
|
|
|
>Derived : Derived
|
|
|
|
>r : Base
|
|
|
|
>Base : Base
|
|
|
|
>Derived : Derived
|
|
|
|
|
|
|
|
var a8: (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived;
|
|
|
|
>a8 : (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived
|
|
|
|
>x : (arg: Base) => Derived
|
|
|
|
>arg : Base
|
|
|
|
>Base : Base
|
|
|
|
>Derived : Derived
|
|
|
|
>y : (arg2: Base) => Derived
|
|
|
|
>arg2 : Base
|
|
|
|
>Base : Base
|
|
|
|
>Derived : Derived
|
|
|
|
>r : Base
|
|
|
|
>Base : Base
|
|
|
|
>Derived : Derived
|
|
|
|
|
|
|
|
var a9: (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived;
|
|
|
|
>a9 : (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived
|
|
|
|
>x : (arg: Base) => Derived
|
|
|
|
>arg : Base
|
|
|
|
>Base : Base
|
|
|
|
>Derived : Derived
|
|
|
|
>y : (arg2: Base) => Derived
|
|
|
|
>arg2 : Base
|
|
|
|
>Base : Base
|
|
|
|
>Derived : Derived
|
|
|
|
>r : Base
|
|
|
|
>Base : Base
|
|
|
|
>Derived : Derived
|
|
|
|
|
|
|
|
var a10: (...x: Derived[]) => Derived;
|
|
|
|
>a10 : (...x: Derived[]) => Derived
|
|
|
|
>x : Derived[]
|
|
|
|
>Derived : Derived
|
|
|
|
>Derived : Derived
|
|
|
|
|
|
|
|
var a11: (x: { foo: string }, y: { foo: string; bar: string }) => Base;
|
|
|
|
>a11 : (x: { foo: string; }, y: { foo: string; bar: string; }) => Base
|
|
|
|
>x : { foo: string; }
|
|
|
|
>foo : string
|
|
|
|
>y : { foo: string; bar: string; }
|
|
|
|
>foo : string
|
|
|
|
>bar : string
|
|
|
|
>Base : Base
|
|
|
|
|
|
|
|
var a12: (x: Array<Base>, y: Array<Derived2>) => Array<Derived>;
|
|
|
|
>a12 : (x: Base[], y: Derived2[]) => Derived[]
|
|
|
|
>x : Base[]
|
2014-08-19 04:56:03 +02:00
|
|
|
>Array : T[]
|
2014-08-15 23:33:16 +02:00
|
|
|
>Base : Base
|
|
|
|
>y : Derived2[]
|
2014-08-19 04:56:03 +02:00
|
|
|
>Array : T[]
|
2014-08-15 23:33:16 +02:00
|
|
|
>Derived2 : Derived2
|
2014-08-19 04:56:03 +02:00
|
|
|
>Array : T[]
|
2014-08-15 23:33:16 +02:00
|
|
|
>Derived : Derived
|
|
|
|
|
|
|
|
var a13: (x: Array<Base>, y: Array<Derived>) => Array<Derived>;
|
|
|
|
>a13 : (x: Base[], y: Derived[]) => Derived[]
|
|
|
|
>x : Base[]
|
2014-08-19 04:56:03 +02:00
|
|
|
>Array : T[]
|
2014-08-15 23:33:16 +02:00
|
|
|
>Base : Base
|
|
|
|
>y : Derived[]
|
2014-08-19 04:56:03 +02:00
|
|
|
>Array : T[]
|
2014-08-15 23:33:16 +02:00
|
|
|
>Derived : Derived
|
2014-08-19 04:56:03 +02:00
|
|
|
>Array : T[]
|
2014-08-15 23:33:16 +02:00
|
|
|
>Derived : Derived
|
|
|
|
|
|
|
|
var a14: (x: { a: string; b: number }) => Object;
|
|
|
|
>a14 : (x: { a: string; b: number; }) => Object
|
|
|
|
>x : { a: string; b: number; }
|
|
|
|
>a : string
|
|
|
|
>b : number
|
|
|
|
>Object : Object
|
|
|
|
|
|
|
|
var a15: {
|
|
|
|
>a15 : { (x: number): number[]; (x: string): string[]; }
|
|
|
|
|
|
|
|
(x: number): number[];
|
|
|
|
>x : number
|
|
|
|
|
|
|
|
(x: string): string[];
|
|
|
|
>x : string
|
|
|
|
}
|
|
|
|
var a16: {
|
|
|
|
>a16 : { <T extends Derived>(x: T): number[]; <U extends Base>(x: U): number[]; }
|
|
|
|
|
|
|
|
<T extends Derived>(x: T): number[];
|
|
|
|
>T : T
|
|
|
|
>Derived : Derived
|
|
|
|
>x : T
|
|
|
|
>T : T
|
|
|
|
|
|
|
|
<U extends Base>(x: U): number[];
|
|
|
|
>U : U
|
|
|
|
>Base : Base
|
|
|
|
>x : U
|
|
|
|
>U : U
|
|
|
|
}
|
|
|
|
var a17: {
|
|
|
|
>a17 : { (x: (a: number) => number): number[]; (x: (a: string) => string): string[]; }
|
|
|
|
|
|
|
|
(x: (a: number) => number): number[];
|
|
|
|
>x : (a: number) => number
|
|
|
|
>a : number
|
|
|
|
|
|
|
|
(x: (a: string) => string): string[];
|
|
|
|
>x : (a: string) => string
|
|
|
|
>a : string
|
|
|
|
|
|
|
|
};
|
|
|
|
var a18: {
|
|
|
|
>a18 : { (x: { (a: number): number; (a: string): string; }): any[]; (x: { (a: boolean): boolean; (a: Date): Date; }): any[]; }
|
|
|
|
|
|
|
|
(x: {
|
|
|
|
>x : { (a: number): number; (a: string): string; }
|
|
|
|
|
|
|
|
(a: number): number;
|
|
|
|
>a : number
|
|
|
|
|
|
|
|
(a: string): string;
|
|
|
|
>a : string
|
|
|
|
|
|
|
|
}): any[];
|
|
|
|
(x: {
|
|
|
|
>x : { (a: boolean): boolean; (a: Date): Date; }
|
|
|
|
|
|
|
|
(a: boolean): boolean;
|
|
|
|
>a : boolean
|
|
|
|
|
|
|
|
(a: Date): Date;
|
|
|
|
>a : Date
|
|
|
|
>Date : Date
|
|
|
|
>Date : Date
|
|
|
|
|
|
|
|
}): any[];
|
|
|
|
}
|
|
|
|
|
|
|
|
var b: <T>(x: T) => T[];
|
|
|
|
>b : <T>(x: T) => T[]
|
|
|
|
>T : T
|
|
|
|
>x : T
|
|
|
|
>T : T
|
|
|
|
>T : T
|
|
|
|
|
|
|
|
a = b; // ok
|
|
|
|
>a = b : <T>(x: T) => T[]
|
|
|
|
>a : (x: number) => number[]
|
|
|
|
>b : <T>(x: T) => T[]
|
|
|
|
|
|
|
|
b = a; // ok
|
|
|
|
>b = a : (x: number) => number[]
|
|
|
|
>b : <T>(x: T) => T[]
|
|
|
|
>a : (x: number) => number[]
|
|
|
|
|
|
|
|
var b2: <T>(x: T) => string[];
|
|
|
|
>b2 : <T>(x: T) => string[]
|
|
|
|
>T : T
|
|
|
|
>x : T
|
|
|
|
>T : T
|
|
|
|
|
|
|
|
a2 = b2; // ok
|
|
|
|
>a2 = b2 : <T>(x: T) => string[]
|
|
|
|
>a2 : (x: number) => string[]
|
|
|
|
>b2 : <T>(x: T) => string[]
|
|
|
|
|
|
|
|
b2 = a2; // ok
|
|
|
|
>b2 = a2 : (x: number) => string[]
|
|
|
|
>b2 : <T>(x: T) => string[]
|
|
|
|
>a2 : (x: number) => string[]
|
|
|
|
|
|
|
|
var b3: <T>(x: T) => T;
|
|
|
|
>b3 : <T>(x: T) => T
|
|
|
|
>T : T
|
|
|
|
>x : T
|
|
|
|
>T : T
|
|
|
|
>T : T
|
|
|
|
|
|
|
|
a3 = b3; // ok
|
|
|
|
>a3 = b3 : <T>(x: T) => T
|
|
|
|
>a3 : (x: number) => void
|
|
|
|
>b3 : <T>(x: T) => T
|
|
|
|
|
|
|
|
b3 = a3; // ok
|
|
|
|
>b3 = a3 : (x: number) => void
|
|
|
|
>b3 : <T>(x: T) => T
|
|
|
|
>a3 : (x: number) => void
|
|
|
|
|
|
|
|
var b4: <T, U>(x: T, y: U) => T;
|
|
|
|
>b4 : <T, U>(x: T, y: U) => T
|
|
|
|
>T : T
|
|
|
|
>U : U
|
|
|
|
>x : T
|
|
|
|
>T : T
|
|
|
|
>y : U
|
|
|
|
>U : U
|
|
|
|
>T : T
|
|
|
|
|
|
|
|
a4 = b4; // ok
|
|
|
|
>a4 = b4 : <T, U>(x: T, y: U) => T
|
|
|
|
>a4 : (x: string, y: number) => string
|
|
|
|
>b4 : <T, U>(x: T, y: U) => T
|
|
|
|
|
|
|
|
b4 = a4; // ok
|
|
|
|
>b4 = a4 : (x: string, y: number) => string
|
|
|
|
>b4 : <T, U>(x: T, y: U) => T
|
|
|
|
>a4 : (x: string, y: number) => string
|
|
|
|
|
|
|
|
var b5: <T, U>(x: (arg: T) => U) => T;
|
|
|
|
>b5 : <T, U>(x: (arg: T) => U) => T
|
|
|
|
>T : T
|
|
|
|
>U : U
|
|
|
|
>x : (arg: T) => U
|
|
|
|
>arg : T
|
|
|
|
>T : T
|
|
|
|
>U : U
|
|
|
|
>T : T
|
|
|
|
|
|
|
|
a5 = b5; // ok
|
|
|
|
>a5 = b5 : <T, U>(x: (arg: T) => U) => T
|
|
|
|
>a5 : (x: (arg: string) => number) => string
|
|
|
|
>b5 : <T, U>(x: (arg: T) => U) => T
|
|
|
|
|
|
|
|
b5 = a5; // ok
|
|
|
|
>b5 = a5 : (x: (arg: string) => number) => string
|
|
|
|
>b5 : <T, U>(x: (arg: T) => U) => T
|
|
|
|
>a5 : (x: (arg: string) => number) => string
|
|
|
|
|
|
|
|
var b6: <T extends Base, U extends Derived>(x: (arg: T) => U) => T;
|
|
|
|
>b6 : <T extends Base, U extends Derived>(x: (arg: T) => U) => T
|
|
|
|
>T : T
|
|
|
|
>Base : Base
|
|
|
|
>U : U
|
|
|
|
>Derived : Derived
|
|
|
|
>x : (arg: T) => U
|
|
|
|
>arg : T
|
|
|
|
>T : T
|
|
|
|
>U : U
|
|
|
|
>T : T
|
|
|
|
|
|
|
|
a6 = b6; // ok
|
|
|
|
>a6 = b6 : <T extends Base, U extends Derived>(x: (arg: T) => U) => T
|
|
|
|
>a6 : (x: (arg: Base) => Derived) => Base
|
|
|
|
>b6 : <T extends Base, U extends Derived>(x: (arg: T) => U) => T
|
|
|
|
|
|
|
|
b6 = a6; // ok
|
|
|
|
>b6 = a6 : (x: (arg: Base) => Derived) => Base
|
|
|
|
>b6 : <T extends Base, U extends Derived>(x: (arg: T) => U) => T
|
|
|
|
>a6 : (x: (arg: Base) => Derived) => Base
|
|
|
|
|
|
|
|
var b7: <T extends Base, U extends Derived>(x: (arg: T) => U) => (r: T) => U;
|
|
|
|
>b7 : <T extends Base, U extends Derived>(x: (arg: T) => U) => (r: T) => U
|
|
|
|
>T : T
|
|
|
|
>Base : Base
|
|
|
|
>U : U
|
|
|
|
>Derived : Derived
|
|
|
|
>x : (arg: T) => U
|
|
|
|
>arg : T
|
|
|
|
>T : T
|
|
|
|
>U : U
|
|
|
|
>r : T
|
|
|
|
>T : T
|
|
|
|
>U : U
|
|
|
|
|
|
|
|
a7 = b7; // ok
|
|
|
|
>a7 = b7 : <T extends Base, U extends Derived>(x: (arg: T) => U) => (r: T) => U
|
|
|
|
>a7 : (x: (arg: Base) => Derived) => (r: Base) => Derived
|
|
|
|
>b7 : <T extends Base, U extends Derived>(x: (arg: T) => U) => (r: T) => U
|
|
|
|
|
|
|
|
b7 = a7; // ok
|
|
|
|
>b7 = a7 : (x: (arg: Base) => Derived) => (r: Base) => Derived
|
|
|
|
>b7 : <T extends Base, U extends Derived>(x: (arg: T) => U) => (r: T) => U
|
|
|
|
>a7 : (x: (arg: Base) => Derived) => (r: Base) => Derived
|
|
|
|
|
|
|
|
var b8: <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: T) => U) => (r: T) => U;
|
|
|
|
>b8 : <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: T) => U) => (r: T) => U
|
|
|
|
>T : T
|
|
|
|
>Base : Base
|
|
|
|
>U : U
|
|
|
|
>Derived : Derived
|
|
|
|
>x : (arg: T) => U
|
|
|
|
>arg : T
|
|
|
|
>T : T
|
|
|
|
>U : U
|
|
|
|
>y : (arg2: T) => U
|
|
|
|
>arg2 : T
|
|
|
|
>T : T
|
|
|
|
>U : U
|
|
|
|
>r : T
|
|
|
|
>T : T
|
|
|
|
>U : U
|
|
|
|
|
|
|
|
a8 = b8; // ok
|
|
|
|
>a8 = b8 : <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: T) => U) => (r: T) => U
|
|
|
|
>a8 : (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived
|
|
|
|
>b8 : <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: T) => U) => (r: T) => U
|
|
|
|
|
|
|
|
b8 = a8; // ok
|
|
|
|
>b8 = a8 : (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived
|
|
|
|
>b8 : <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: T) => U) => (r: T) => U
|
|
|
|
>a8 : (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived
|
|
|
|
|
|
|
|
var b9: <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: string; bing: number }) => U) => (r: T) => U;
|
|
|
|
>b9 : <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: string; bing: number; }) => U) => (r: T) => U
|
|
|
|
>T : T
|
|
|
|
>Base : Base
|
|
|
|
>U : U
|
|
|
|
>Derived : Derived
|
|
|
|
>x : (arg: T) => U
|
|
|
|
>arg : T
|
|
|
|
>T : T
|
|
|
|
>U : U
|
|
|
|
>y : (arg2: { foo: string; bing: number; }) => U
|
|
|
|
>arg2 : { foo: string; bing: number; }
|
|
|
|
>foo : string
|
|
|
|
>bing : number
|
|
|
|
>U : U
|
|
|
|
>r : T
|
|
|
|
>T : T
|
|
|
|
>U : U
|
|
|
|
|
|
|
|
a9 = b9; // ok
|
|
|
|
>a9 = b9 : <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: string; bing: number; }) => U) => (r: T) => U
|
|
|
|
>a9 : (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived
|
|
|
|
>b9 : <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: string; bing: number; }) => U) => (r: T) => U
|
|
|
|
|
|
|
|
b9 = a9; // ok
|
|
|
|
>b9 = a9 : (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived
|
|
|
|
>b9 : <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: string; bing: number; }) => U) => (r: T) => U
|
|
|
|
>a9 : (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived
|
|
|
|
|
|
|
|
var b10: <T extends Derived>(...x: T[]) => T;
|
|
|
|
>b10 : <T extends Derived>(...x: T[]) => T
|
|
|
|
>T : T
|
|
|
|
>Derived : Derived
|
|
|
|
>x : T[]
|
|
|
|
>T : T
|
|
|
|
>T : T
|
|
|
|
|
|
|
|
a10 = b10; // ok
|
|
|
|
>a10 = b10 : <T extends Derived>(...x: T[]) => T
|
|
|
|
>a10 : (...x: Derived[]) => Derived
|
|
|
|
>b10 : <T extends Derived>(...x: T[]) => T
|
|
|
|
|
|
|
|
b10 = a10; // ok
|
|
|
|
>b10 = a10 : (...x: Derived[]) => Derived
|
|
|
|
>b10 : <T extends Derived>(...x: T[]) => T
|
|
|
|
>a10 : (...x: Derived[]) => Derived
|
|
|
|
|
|
|
|
var b11: <T extends Base>(x: T, y: T) => T;
|
|
|
|
>b11 : <T extends Base>(x: T, y: T) => T
|
|
|
|
>T : T
|
|
|
|
>Base : Base
|
|
|
|
>x : T
|
|
|
|
>T : T
|
|
|
|
>y : T
|
|
|
|
>T : T
|
|
|
|
>T : T
|
|
|
|
|
|
|
|
a11 = b11; // ok
|
|
|
|
>a11 = b11 : <T extends Base>(x: T, y: T) => T
|
|
|
|
>a11 : (x: { foo: string; }, y: { foo: string; bar: string; }) => Base
|
|
|
|
>b11 : <T extends Base>(x: T, y: T) => T
|
|
|
|
|
|
|
|
b11 = a11; // ok
|
|
|
|
>b11 = a11 : (x: { foo: string; }, y: { foo: string; bar: string; }) => Base
|
|
|
|
>b11 : <T extends Base>(x: T, y: T) => T
|
|
|
|
>a11 : (x: { foo: string; }, y: { foo: string; bar: string; }) => Base
|
|
|
|
|
|
|
|
var b12: <T extends Array<Base>>(x: Array<Base>, y: T) => Array<Derived>;
|
|
|
|
>b12 : <T extends Base[]>(x: Base[], y: T) => Derived[]
|
|
|
|
>T : T
|
2014-08-19 04:56:03 +02:00
|
|
|
>Array : T[]
|
2014-08-15 23:33:16 +02:00
|
|
|
>Base : Base
|
|
|
|
>x : Base[]
|
2014-08-19 04:56:03 +02:00
|
|
|
>Array : T[]
|
2014-08-15 23:33:16 +02:00
|
|
|
>Base : Base
|
|
|
|
>y : T
|
|
|
|
>T : T
|
2014-08-19 04:56:03 +02:00
|
|
|
>Array : T[]
|
2014-08-15 23:33:16 +02:00
|
|
|
>Derived : Derived
|
|
|
|
|
|
|
|
a12 = b12; // ok
|
|
|
|
>a12 = b12 : <T extends Base[]>(x: Base[], y: T) => Derived[]
|
|
|
|
>a12 : (x: Base[], y: Derived2[]) => Derived[]
|
|
|
|
>b12 : <T extends Base[]>(x: Base[], y: T) => Derived[]
|
|
|
|
|
|
|
|
b12 = a12; // ok
|
|
|
|
>b12 = a12 : (x: Base[], y: Derived2[]) => Derived[]
|
|
|
|
>b12 : <T extends Base[]>(x: Base[], y: T) => Derived[]
|
|
|
|
>a12 : (x: Base[], y: Derived2[]) => Derived[]
|
|
|
|
|
|
|
|
var b13: <T extends Array<Derived>>(x: Array<Base>, y: T) => T;
|
|
|
|
>b13 : <T extends Derived[]>(x: Base[], y: T) => T
|
|
|
|
>T : T
|
2014-08-19 04:56:03 +02:00
|
|
|
>Array : T[]
|
2014-08-15 23:33:16 +02:00
|
|
|
>Derived : Derived
|
|
|
|
>x : Base[]
|
2014-08-19 04:56:03 +02:00
|
|
|
>Array : T[]
|
2014-08-15 23:33:16 +02:00
|
|
|
>Base : Base
|
|
|
|
>y : T
|
|
|
|
>T : T
|
|
|
|
>T : T
|
|
|
|
|
|
|
|
a13 = b13; // ok
|
|
|
|
>a13 = b13 : <T extends Derived[]>(x: Base[], y: T) => T
|
|
|
|
>a13 : (x: Base[], y: Derived[]) => Derived[]
|
|
|
|
>b13 : <T extends Derived[]>(x: Base[], y: T) => T
|
|
|
|
|
|
|
|
b13 = a13; // ok
|
|
|
|
>b13 = a13 : (x: Base[], y: Derived[]) => Derived[]
|
|
|
|
>b13 : <T extends Derived[]>(x: Base[], y: T) => T
|
|
|
|
>a13 : (x: Base[], y: Derived[]) => Derived[]
|
|
|
|
|
|
|
|
var b14: <T>(x: { a: T; b: T }) => T;
|
|
|
|
>b14 : <T>(x: { a: T; b: T; }) => T
|
|
|
|
>T : T
|
|
|
|
>x : { a: T; b: T; }
|
|
|
|
>a : T
|
|
|
|
>T : T
|
|
|
|
>b : T
|
|
|
|
>T : T
|
|
|
|
>T : T
|
|
|
|
|
|
|
|
a14 = b14; // ok
|
|
|
|
>a14 = b14 : <T>(x: { a: T; b: T; }) => T
|
|
|
|
>a14 : (x: { a: string; b: number; }) => Object
|
|
|
|
>b14 : <T>(x: { a: T; b: T; }) => T
|
|
|
|
|
|
|
|
b14 = a14; // ok
|
|
|
|
>b14 = a14 : (x: { a: string; b: number; }) => Object
|
|
|
|
>b14 : <T>(x: { a: T; b: T; }) => T
|
|
|
|
>a14 : (x: { a: string; b: number; }) => Object
|
|
|
|
|
|
|
|
var b15: <T>(x: T) => T[];
|
|
|
|
>b15 : <T>(x: T) => T[]
|
|
|
|
>T : T
|
|
|
|
>x : T
|
|
|
|
>T : T
|
|
|
|
>T : T
|
|
|
|
|
|
|
|
a15 = b15; // ok
|
|
|
|
>a15 = b15 : <T>(x: T) => T[]
|
|
|
|
>a15 : { (x: number): number[]; (x: string): string[]; }
|
|
|
|
>b15 : <T>(x: T) => T[]
|
|
|
|
|
|
|
|
b15 = a15; // ok
|
|
|
|
>b15 = a15 : { (x: number): number[]; (x: string): string[]; }
|
|
|
|
>b15 : <T>(x: T) => T[]
|
|
|
|
>a15 : { (x: number): number[]; (x: string): string[]; }
|
|
|
|
|
|
|
|
var b16: <T extends Base>(x: T) => number[];
|
|
|
|
>b16 : <T extends Base>(x: T) => number[]
|
|
|
|
>T : T
|
|
|
|
>Base : Base
|
|
|
|
>x : T
|
|
|
|
>T : T
|
|
|
|
|
|
|
|
a16 = b16; // ok
|
|
|
|
>a16 = b16 : <T extends Base>(x: T) => number[]
|
|
|
|
>a16 : { <T extends Derived>(x: T): number[]; <U extends Base>(x: U): number[]; }
|
|
|
|
>b16 : <T extends Base>(x: T) => number[]
|
|
|
|
|
|
|
|
b16 = a16; // ok
|
|
|
|
>b16 = a16 : { <T extends Derived>(x: T): number[]; <U extends Base>(x: U): number[]; }
|
|
|
|
>b16 : <T extends Base>(x: T) => number[]
|
|
|
|
>a16 : { <T extends Derived>(x: T): number[]; <U extends Base>(x: U): number[]; }
|
|
|
|
|
|
|
|
var b17: <T>(x: (a: T) => T) => T[]; // ok
|
|
|
|
>b17 : <T>(x: (a: T) => T) => T[]
|
|
|
|
>T : T
|
|
|
|
>x : (a: T) => T
|
|
|
|
>a : T
|
|
|
|
>T : T
|
|
|
|
>T : T
|
|
|
|
>T : T
|
|
|
|
|
|
|
|
a17 = b17; // ok
|
|
|
|
>a17 = b17 : <T>(x: (a: T) => T) => T[]
|
|
|
|
>a17 : { (x: (a: number) => number): number[]; (x: (a: string) => string): string[]; }
|
|
|
|
>b17 : <T>(x: (a: T) => T) => T[]
|
|
|
|
|
|
|
|
b17 = a17; // ok
|
|
|
|
>b17 = a17 : { (x: (a: number) => number): number[]; (x: (a: string) => string): string[]; }
|
|
|
|
>b17 : <T>(x: (a: T) => T) => T[]
|
|
|
|
>a17 : { (x: (a: number) => number): number[]; (x: (a: string) => string): string[]; }
|
|
|
|
|
|
|
|
var b18: <T>(x: (a: T) => T) => T[];
|
|
|
|
>b18 : <T>(x: (a: T) => T) => T[]
|
|
|
|
>T : T
|
|
|
|
>x : (a: T) => T
|
|
|
|
>a : T
|
|
|
|
>T : T
|
|
|
|
>T : T
|
|
|
|
>T : T
|
|
|
|
|
|
|
|
a18 = b18; // ok
|
|
|
|
>a18 = b18 : <T>(x: (a: T) => T) => T[]
|
|
|
|
>a18 : { (x: { (a: number): number; (a: string): string; }): any[]; (x: { (a: boolean): boolean; (a: Date): Date; }): any[]; }
|
|
|
|
>b18 : <T>(x: (a: T) => T) => T[]
|
|
|
|
|
|
|
|
b18 = a18; // ok
|
|
|
|
>b18 = a18 : { (x: { (a: number): number; (a: string): string; }): any[]; (x: { (a: boolean): boolean; (a: Date): Date; }): any[]; }
|
|
|
|
>b18 : <T>(x: (a: T) => T) => T[]
|
|
|
|
>a18 : { (x: { (a: number): number; (a: string): string; }): any[]; (x: { (a: boolean): boolean; (a: Date): Date; }): any[]; }
|
|
|
|
|