TypeScript/tests/baselines/reference/functionLiteralForOverloads2.types
2015-04-15 16:44:20 -07:00

79 lines
1.1 KiB
Plaintext

=== tests/cases/conformance/types/specifyingTypes/typeLiterals/functionLiteralForOverloads2.ts ===
// basic uses of function literals with constructor overloads
class C {
>C : C
constructor(x: string);
>x : string
constructor(x: number);
>x : number
constructor(x) { }
>x : any
}
class D<T> {
>D : D<T>
>T : T
constructor(x: string);
>x : string
constructor(x: number);
>x : number
constructor(x) { }
>x : any
}
var f: {
>f : { new (x: string): C; new (x: number): C; }
new(x: string): C;
>x : string
>C : C
new(x: number): C;
>x : number
>C : C
} = C;
>C : typeof C
var f2: {
>f2 : { new <T>(x: string): C; new <T>(x: number): C; }
new<T>(x: string): C;
>T : T
>x : string
>C : C
new<T>(x: number): C;
>T : T
>x : number
>C : C
} = C;
>C : typeof C
var f3: {
>f3 : { new <T>(x: string): D<T>; new <T>(x: number): D<T>; }
new<T>(x: string): D<T>;
>T : T
>x : string
>D : D<T>
>T : T
new<T>(x: number): D<T>;
>T : T
>x : number
>D : D<T>
>T : T
} = D;
>D : typeof D