2014-08-15 23:33:16 +02:00
|
|
|
=== tests/cases/conformance/types/objectTypeLiteral/constructSignatures/constructSignaturesWithOverloads.ts ===
|
|
|
|
// No errors expected for basic overloads of construct signatures
|
|
|
|
|
|
|
|
class C {
|
2015-04-13 23:01:57 +02:00
|
|
|
>C : C, Symbol(C, Decl(constructSignaturesWithOverloads.ts, 0, 0))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
constructor(x: number, y?: string);
|
2015-04-13 23:01:57 +02:00
|
|
|
>x : number, Symbol(x, Decl(constructSignaturesWithOverloads.ts, 3, 16))
|
|
|
|
>y : string, Symbol(y, Decl(constructSignaturesWithOverloads.ts, 3, 26))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
constructor(x: number, y: string);
|
2015-04-13 23:01:57 +02:00
|
|
|
>x : number, Symbol(x, Decl(constructSignaturesWithOverloads.ts, 4, 16))
|
|
|
|
>y : string, Symbol(y, Decl(constructSignaturesWithOverloads.ts, 4, 26))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
constructor(x: number) { }
|
2015-04-13 23:01:57 +02:00
|
|
|
>x : number, Symbol(x, Decl(constructSignaturesWithOverloads.ts, 5, 16))
|
2014-08-15 23:33:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
var r1 = new C(1, '');
|
2015-04-13 23:01:57 +02:00
|
|
|
>r1 : C, Symbol(r1, Decl(constructSignaturesWithOverloads.ts, 8, 3))
|
2014-08-15 23:33:16 +02:00
|
|
|
>new C(1, '') : C
|
2015-04-13 23:01:57 +02:00
|
|
|
>C : typeof C, Symbol(C, Decl(constructSignaturesWithOverloads.ts, 0, 0))
|
2015-04-13 21:36:11 +02:00
|
|
|
>1 : number
|
|
|
|
>'' : string
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
class C2<T> {
|
2015-04-13 23:01:57 +02:00
|
|
|
>C2 : C2<T>, Symbol(C2, Decl(constructSignaturesWithOverloads.ts, 8, 22))
|
|
|
|
>T : T, Symbol(T, Decl(constructSignaturesWithOverloads.ts, 10, 9))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
constructor(x: T, y?: string);
|
2015-04-13 23:01:57 +02:00
|
|
|
>x : T, Symbol(x, Decl(constructSignaturesWithOverloads.ts, 11, 16))
|
|
|
|
>T : T, Symbol(T, Decl(constructSignaturesWithOverloads.ts, 10, 9))
|
|
|
|
>y : string, Symbol(y, Decl(constructSignaturesWithOverloads.ts, 11, 21))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
constructor(x: T, y: string);
|
2015-04-13 23:01:57 +02:00
|
|
|
>x : T, Symbol(x, Decl(constructSignaturesWithOverloads.ts, 12, 16))
|
|
|
|
>T : T, Symbol(T, Decl(constructSignaturesWithOverloads.ts, 10, 9))
|
|
|
|
>y : string, Symbol(y, Decl(constructSignaturesWithOverloads.ts, 12, 21))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
constructor(x: T) { }
|
2015-04-13 23:01:57 +02:00
|
|
|
>x : T, Symbol(x, Decl(constructSignaturesWithOverloads.ts, 13, 16))
|
|
|
|
>T : T, Symbol(T, Decl(constructSignaturesWithOverloads.ts, 10, 9))
|
2014-08-15 23:33:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
var r2 = new C2(1, '');
|
2015-04-13 23:01:57 +02:00
|
|
|
>r2 : C2<number>, Symbol(r2, Decl(constructSignaturesWithOverloads.ts, 16, 3))
|
2014-08-15 23:33:16 +02:00
|
|
|
>new C2(1, '') : C2<number>
|
2015-04-13 23:01:57 +02:00
|
|
|
>C2 : typeof C2, Symbol(C2, Decl(constructSignaturesWithOverloads.ts, 8, 22))
|
2015-04-13 21:36:11 +02:00
|
|
|
>1 : number
|
|
|
|
>'' : string
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
interface I {
|
2015-04-13 23:01:57 +02:00
|
|
|
>I : I, Symbol(I, Decl(constructSignaturesWithOverloads.ts, 16, 23))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
new(x: number, y?: string): C;
|
2015-04-13 23:01:57 +02:00
|
|
|
>x : number, Symbol(x, Decl(constructSignaturesWithOverloads.ts, 19, 8))
|
|
|
|
>y : string, Symbol(y, Decl(constructSignaturesWithOverloads.ts, 19, 18))
|
|
|
|
>C : C, Symbol(C, Decl(constructSignaturesWithOverloads.ts, 0, 0))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
new(x: number, y: string): C;
|
2015-04-13 23:01:57 +02:00
|
|
|
>x : number, Symbol(x, Decl(constructSignaturesWithOverloads.ts, 20, 8))
|
|
|
|
>y : string, Symbol(y, Decl(constructSignaturesWithOverloads.ts, 20, 18))
|
|
|
|
>C : C, Symbol(C, Decl(constructSignaturesWithOverloads.ts, 0, 0))
|
2014-08-15 23:33:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
var i: I;
|
2015-04-13 23:01:57 +02:00
|
|
|
>i : I, Symbol(i, Decl(constructSignaturesWithOverloads.ts, 23, 3))
|
|
|
|
>I : I, Symbol(I, Decl(constructSignaturesWithOverloads.ts, 16, 23))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
var r3 = new i(1, '');
|
2015-04-13 23:01:57 +02:00
|
|
|
>r3 : C, Symbol(r3, Decl(constructSignaturesWithOverloads.ts, 24, 3))
|
2014-08-15 23:33:16 +02:00
|
|
|
>new i(1, '') : C
|
2015-04-13 23:01:57 +02:00
|
|
|
>i : I, Symbol(i, Decl(constructSignaturesWithOverloads.ts, 23, 3))
|
2015-04-13 21:36:11 +02:00
|
|
|
>1 : number
|
|
|
|
>'' : string
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
interface I2<T> {
|
2015-04-13 23:01:57 +02:00
|
|
|
>I2 : I2<T>, Symbol(I2, Decl(constructSignaturesWithOverloads.ts, 24, 22))
|
|
|
|
>T : T, Symbol(T, Decl(constructSignaturesWithOverloads.ts, 26, 13))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
new (x: T, y?: string): C2<T>;
|
2015-04-13 23:01:57 +02:00
|
|
|
>x : T, Symbol(x, Decl(constructSignaturesWithOverloads.ts, 27, 9))
|
|
|
|
>T : T, Symbol(T, Decl(constructSignaturesWithOverloads.ts, 26, 13))
|
|
|
|
>y : string, Symbol(y, Decl(constructSignaturesWithOverloads.ts, 27, 14))
|
|
|
|
>C2 : C2<T>, Symbol(C2, Decl(constructSignaturesWithOverloads.ts, 8, 22))
|
|
|
|
>T : T, Symbol(T, Decl(constructSignaturesWithOverloads.ts, 26, 13))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
new (x: T, y: string): C2<T>;
|
2015-04-13 23:01:57 +02:00
|
|
|
>x : T, Symbol(x, Decl(constructSignaturesWithOverloads.ts, 28, 9))
|
|
|
|
>T : T, Symbol(T, Decl(constructSignaturesWithOverloads.ts, 26, 13))
|
|
|
|
>y : string, Symbol(y, Decl(constructSignaturesWithOverloads.ts, 28, 14))
|
|
|
|
>C2 : C2<T>, Symbol(C2, Decl(constructSignaturesWithOverloads.ts, 8, 22))
|
|
|
|
>T : T, Symbol(T, Decl(constructSignaturesWithOverloads.ts, 26, 13))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
new <T>(x: T, y?: string): C2<T>;
|
2015-04-13 23:01:57 +02:00
|
|
|
>T : T, Symbol(T, Decl(constructSignaturesWithOverloads.ts, 29, 9))
|
|
|
|
>x : T, Symbol(x, Decl(constructSignaturesWithOverloads.ts, 29, 12))
|
|
|
|
>T : T, Symbol(T, Decl(constructSignaturesWithOverloads.ts, 29, 9))
|
|
|
|
>y : string, Symbol(y, Decl(constructSignaturesWithOverloads.ts, 29, 17))
|
|
|
|
>C2 : C2<T>, Symbol(C2, Decl(constructSignaturesWithOverloads.ts, 8, 22))
|
|
|
|
>T : T, Symbol(T, Decl(constructSignaturesWithOverloads.ts, 29, 9))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
new <T>(x: T, y: string): C2<T>;
|
2015-04-13 23:01:57 +02:00
|
|
|
>T : T, Symbol(T, Decl(constructSignaturesWithOverloads.ts, 30, 9))
|
|
|
|
>x : T, Symbol(x, Decl(constructSignaturesWithOverloads.ts, 30, 12))
|
|
|
|
>T : T, Symbol(T, Decl(constructSignaturesWithOverloads.ts, 30, 9))
|
|
|
|
>y : string, Symbol(y, Decl(constructSignaturesWithOverloads.ts, 30, 17))
|
|
|
|
>C2 : C2<T>, Symbol(C2, Decl(constructSignaturesWithOverloads.ts, 8, 22))
|
|
|
|
>T : T, Symbol(T, Decl(constructSignaturesWithOverloads.ts, 30, 9))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
var i2: I2<number>;
|
2015-04-13 23:01:57 +02:00
|
|
|
>i2 : I2<number>, Symbol(i2, Decl(constructSignaturesWithOverloads.ts, 34, 3))
|
|
|
|
>I2 : I2<T>, Symbol(I2, Decl(constructSignaturesWithOverloads.ts, 24, 22))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
var r4 = new i2(1, '');
|
2015-04-13 23:01:57 +02:00
|
|
|
>r4 : C2<number>, Symbol(r4, Decl(constructSignaturesWithOverloads.ts, 35, 3))
|
2014-08-15 23:33:16 +02:00
|
|
|
>new i2(1, '') : C2<number>
|
2015-04-13 23:01:57 +02:00
|
|
|
>i2 : I2<number>, Symbol(i2, Decl(constructSignaturesWithOverloads.ts, 34, 3))
|
2015-04-13 21:36:11 +02:00
|
|
|
>1 : number
|
|
|
|
>'' : string
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
var a: {
|
2015-04-13 23:01:57 +02:00
|
|
|
>a : { new (x: number, y?: string): C; new (x: number, y: string): C; }, Symbol(a, Decl(constructSignaturesWithOverloads.ts, 37, 3))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
new(x: number, y?: string): C;
|
2015-04-13 23:01:57 +02:00
|
|
|
>x : number, Symbol(x, Decl(constructSignaturesWithOverloads.ts, 38, 8))
|
|
|
|
>y : string, Symbol(y, Decl(constructSignaturesWithOverloads.ts, 38, 18))
|
|
|
|
>C : C, Symbol(C, Decl(constructSignaturesWithOverloads.ts, 0, 0))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
new(x: number, y: string): C;
|
2015-04-13 23:01:57 +02:00
|
|
|
>x : number, Symbol(x, Decl(constructSignaturesWithOverloads.ts, 39, 8))
|
|
|
|
>y : string, Symbol(y, Decl(constructSignaturesWithOverloads.ts, 39, 18))
|
|
|
|
>C : C, Symbol(C, Decl(constructSignaturesWithOverloads.ts, 0, 0))
|
2014-08-15 23:33:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
var r5 = new a(1, '');
|
2015-04-13 23:01:57 +02:00
|
|
|
>r5 : C, Symbol(r5, Decl(constructSignaturesWithOverloads.ts, 42, 3))
|
2014-08-15 23:33:16 +02:00
|
|
|
>new a(1, '') : C
|
2015-04-13 23:01:57 +02:00
|
|
|
>a : { new (x: number, y?: string): C; new (x: number, y: string): C; }, Symbol(a, Decl(constructSignaturesWithOverloads.ts, 37, 3))
|
2015-04-13 21:36:11 +02:00
|
|
|
>1 : number
|
|
|
|
>'' : string
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
var b: {
|
2015-04-13 23:01:57 +02:00
|
|
|
>b : { new <T>(x: T, y?: string): C2<T>; new <T>(x: T, y: string): C2<T>; }, Symbol(b, Decl(constructSignaturesWithOverloads.ts, 44, 3))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
new<T>(x: T, y?: string): C2<T>;
|
2015-04-13 23:01:57 +02:00
|
|
|
>T : T, Symbol(T, Decl(constructSignaturesWithOverloads.ts, 45, 8))
|
|
|
|
>x : T, Symbol(x, Decl(constructSignaturesWithOverloads.ts, 45, 11))
|
|
|
|
>T : T, Symbol(T, Decl(constructSignaturesWithOverloads.ts, 45, 8))
|
|
|
|
>y : string, Symbol(y, Decl(constructSignaturesWithOverloads.ts, 45, 16))
|
|
|
|
>C2 : C2<T>, Symbol(C2, Decl(constructSignaturesWithOverloads.ts, 8, 22))
|
|
|
|
>T : T, Symbol(T, Decl(constructSignaturesWithOverloads.ts, 45, 8))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
new<T>(x: T, y: string): C2<T>;
|
2015-04-13 23:01:57 +02:00
|
|
|
>T : T, Symbol(T, Decl(constructSignaturesWithOverloads.ts, 46, 8))
|
|
|
|
>x : T, Symbol(x, Decl(constructSignaturesWithOverloads.ts, 46, 11))
|
|
|
|
>T : T, Symbol(T, Decl(constructSignaturesWithOverloads.ts, 46, 8))
|
|
|
|
>y : string, Symbol(y, Decl(constructSignaturesWithOverloads.ts, 46, 16))
|
|
|
|
>C2 : C2<T>, Symbol(C2, Decl(constructSignaturesWithOverloads.ts, 8, 22))
|
|
|
|
>T : T, Symbol(T, Decl(constructSignaturesWithOverloads.ts, 46, 8))
|
2014-08-15 23:33:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
var r6 = new b(1, '');
|
2015-04-13 23:01:57 +02:00
|
|
|
>r6 : C2<number>, Symbol(r6, Decl(constructSignaturesWithOverloads.ts, 49, 3))
|
2014-08-15 23:33:16 +02:00
|
|
|
>new b(1, '') : C2<number>
|
2015-04-13 23:01:57 +02:00
|
|
|
>b : { new <T>(x: T, y?: string): C2<T>; new <T>(x: T, y: string): C2<T>; }, Symbol(b, Decl(constructSignaturesWithOverloads.ts, 44, 3))
|
2015-04-13 21:36:11 +02:00
|
|
|
>1 : number
|
|
|
|
>'' : string
|
2014-08-15 23:33:16 +02:00
|
|
|
|