1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
|
=== tests/cases/compiler/constructorOverloads7.ts ===
declare class Point
>Point : Point
{
x: number;
>x : number
y: number;
>y : number
constructor(x: number, y: number);
>x : number
>y : number
add(dx: number, dy: number): Point;
>add : (dx: number, dy: number) => Point
>dx : number
>dy : number
origin: Point;
>origin : Point
}
// Type provided by extern declaration
// Because Point is a constructor function, this is inferred
// to be Point and return type is inferred to be void
function Point(x, y) {
>Point : typeof Point
>x : any
>y : any
this.x = x;
>this.x = x : any
>this.x : any
>this : any
>x : any
>x : any
this.y = y;
>this.y = y : any
>this.y : any
>this : any
>y : any
>y : any
return this;
>this : any
}
declare function EF1(a:number, b:number):number;
>EF1 : (a: number, b: number) => number
>a : number
>b : number
function EF1(a,b) { return a+b; }
>EF1 : (a: number, b: number) => number
>a : any
>b : any
>a+b : any
>a : any
>b : any
|