TypeScript/tests/baselines/reference/topLevel.types

106 lines
1.9 KiB
Plaintext
Raw Normal View History

2014-08-15 23:33:16 +02:00
=== tests/cases/compiler/topLevel.ts ===
interface IPoint {
>IPoint : IPoint
2014-08-15 23:33:16 +02:00
x:number;
>x : number
2014-08-15 23:33:16 +02:00
y:number;
>y : number
2014-08-15 23:33:16 +02:00
}
class Point implements IPoint {
>Point : Point
>IPoint : IPoint
2014-08-15 23:33:16 +02:00
constructor(public x,public y){}
>x : any
>y : any
2014-08-15 23:33:16 +02:00
public move(xo:number,yo:number) {
>move : (xo: number, yo: number) => Point
>xo : number
>yo : number
2014-08-15 23:33:16 +02:00
this.x+=xo;
>this.x+=xo : any
>this.x : any
>this : Point
>x : any
>xo : number
2014-08-15 23:33:16 +02:00
this.y+=yo;
>this.y+=yo : any
>this.y : any
>this : Point
>y : any
>yo : number
2014-08-15 23:33:16 +02:00
return this;
>this : Point
2014-08-15 23:33:16 +02:00
}
public toString() {
>toString : () => string
2014-08-15 23:33:16 +02:00
return ("("+this.x+","+this.y+")");
>("("+this.x+","+this.y+")") : string
>"("+this.x+","+this.y+")" : string
>"("+this.x+","+this.y : string
>"("+this.x+"," : string
>"("+this.x : string
2015-04-13 21:36:11 +02:00
>"(" : string
>this.x : any
>this : Point
>x : any
2015-04-13 21:36:11 +02:00
>"," : string
>this.y : any
>this : Point
>y : any
2015-04-13 21:36:11 +02:00
>")" : string
2014-08-15 23:33:16 +02:00
}
}
var result="";
>result : string
2015-04-13 21:36:11 +02:00
>"" : string
2014-08-15 23:33:16 +02:00
result+=(new Point(3,4).move(2,2));
>result+=(new Point(3,4).move(2,2)) : string
>result : string
2014-08-15 23:33:16 +02:00
>(new Point(3,4).move(2,2)) : Point
>new Point(3,4).move(2,2) : Point
>new Point(3,4).move : (xo: number, yo: number) => Point
2014-08-15 23:33:16 +02:00
>new Point(3,4) : Point
>Point : typeof Point
2015-04-13 21:36:11 +02:00
>3 : number
>4 : number
>move : (xo: number, yo: number) => Point
2015-04-13 21:36:11 +02:00
>2 : number
>2 : number
2014-08-15 23:33:16 +02:00
module M {
>M : typeof M
2014-08-15 23:33:16 +02:00
export var origin=new Point(0,0);
>origin : Point
2014-08-15 23:33:16 +02:00
>new Point(0,0) : Point
>Point : typeof Point
2015-04-13 21:36:11 +02:00
>0 : number
>0 : number
2014-08-15 23:33:16 +02:00
}
result+=(M.origin.move(1,1));
>result+=(M.origin.move(1,1)) : string
>result : string
2014-08-15 23:33:16 +02:00
>(M.origin.move(1,1)) : Point
>M.origin.move(1,1) : Point
>M.origin.move : (xo: number, yo: number) => Point
>M.origin : Point
>M : typeof M
>origin : Point
>move : (xo: number, yo: number) => Point
2015-04-13 21:36:11 +02:00
>1 : number
>1 : number
2014-08-15 23:33:16 +02:00