TypeScript/tests/baselines/reference/castTest.types

115 lines
3.8 KiB
Plaintext
Raw Normal View History

2014-08-15 23:33:16 +02:00
=== tests/cases/compiler/castTest.ts ===
var x : any = 0;
2015-04-13 23:01:57 +02:00
>x : any, Symbol(x, Decl(castTest.ts, 1, 3))
2015-04-13 21:36:11 +02:00
>0 : number
2014-08-15 23:33:16 +02:00
var z = <number> x;
2015-04-13 23:01:57 +02:00
>z : number, Symbol(z, Decl(castTest.ts, 2, 3))
2014-08-15 23:33:16 +02:00
><number> x : number
2015-04-13 23:01:57 +02:00
>x : any, Symbol(x, Decl(castTest.ts, 1, 3))
2014-08-15 23:33:16 +02:00
var y = x + z;
2015-04-13 23:01:57 +02:00
>y : any, Symbol(y, Decl(castTest.ts, 3, 3))
2014-08-15 23:33:16 +02:00
>x + z : any
2015-04-13 23:01:57 +02:00
>x : any, Symbol(x, Decl(castTest.ts, 1, 3))
>z : number, Symbol(z, Decl(castTest.ts, 2, 3))
2014-08-15 23:33:16 +02:00
var a = <any>0;
2015-04-13 23:01:57 +02:00
>a : any, Symbol(a, Decl(castTest.ts, 5, 3))
2014-08-15 23:33:16 +02:00
><any>0 : any
2015-04-13 21:36:11 +02:00
>0 : number
2014-08-15 23:33:16 +02:00
var b = <boolean>true;
2015-04-13 23:01:57 +02:00
>b : boolean, Symbol(b, Decl(castTest.ts, 6, 3))
2014-08-15 23:33:16 +02:00
><boolean>true : boolean
2015-04-13 21:36:11 +02:00
>true : boolean
2014-08-15 23:33:16 +02:00
var s = <string>"";
2015-04-13 23:01:57 +02:00
>s : string, Symbol(s, Decl(castTest.ts, 7, 3))
2014-08-15 23:33:16 +02:00
><string>"" : string
2015-04-13 21:36:11 +02:00
>"" : string
2014-08-15 23:33:16 +02:00
var ar = <any[]>null;
2015-04-13 23:01:57 +02:00
>ar : any[], Symbol(ar, Decl(castTest.ts, 9, 3))
2014-08-15 23:33:16 +02:00
><any[]>null : any[]
2015-04-13 21:36:11 +02:00
>null : null
2014-08-15 23:33:16 +02:00
var f = <(res : number) => void>null;
2015-04-13 23:01:57 +02:00
>f : (res: number) => void, Symbol(f, Decl(castTest.ts, 11, 3))
2014-08-15 23:33:16 +02:00
><(res : number) => void>null : (res: number) => void
2015-04-13 23:01:57 +02:00
>res : number, Symbol(res, Decl(castTest.ts, 11, 10))
2015-04-13 21:36:11 +02:00
>null : null
2014-08-15 23:33:16 +02:00
declare class Point
2015-04-13 23:01:57 +02:00
>Point : Point, Symbol(Point, Decl(castTest.ts, 11, 37))
2014-08-15 23:33:16 +02:00
{
x: number;
2015-04-13 23:01:57 +02:00
>x : number, Symbol(x, Decl(castTest.ts, 14, 1))
2014-08-15 23:33:16 +02:00
y: number;
2015-04-13 23:01:57 +02:00
>y : number, Symbol(y, Decl(castTest.ts, 15, 14))
2014-08-15 23:33:16 +02:00
add(dx: number, dy: number): Point;
2015-04-13 23:01:57 +02:00
>add : (dx: number, dy: number) => Point, Symbol(add, Decl(castTest.ts, 16, 14))
>dx : number, Symbol(dx, Decl(castTest.ts, 17, 8))
>dy : number, Symbol(dy, Decl(castTest.ts, 17, 19))
>Point : Point, Symbol(Point, Decl(castTest.ts, 11, 37))
2014-08-15 23:33:16 +02:00
mult(p: Point): Point;
2015-04-13 23:01:57 +02:00
>mult : (p: Point) => Point, Symbol(mult, Decl(castTest.ts, 17, 39))
>p : Point, Symbol(p, Decl(castTest.ts, 18, 9))
>Point : Point, Symbol(Point, Decl(castTest.ts, 11, 37))
>Point : Point, Symbol(Point, Decl(castTest.ts, 11, 37))
2014-08-15 23:33:16 +02:00
constructor(x: number, y: number);
2015-04-13 23:01:57 +02:00
>x : number, Symbol(x, Decl(castTest.ts, 19, 16))
>y : number, Symbol(y, Decl(castTest.ts, 19, 26))
2014-08-15 23:33:16 +02:00
}
var p_cast = <Point> ({
2015-04-13 23:01:57 +02:00
>p_cast : Point, Symbol(p_cast, Decl(castTest.ts, 22, 3))
2014-08-22 03:39:46 +02:00
><Point> ({ x: 0, y: 0, add: function(dx, dy) { return new Point(this.x + dx, this.y + dy); }, mult: function(p) { return p; }}) : Point
2015-04-13 23:01:57 +02:00
>Point : Point, Symbol(Point, Decl(castTest.ts, 11, 37))
>({ x: 0, y: 0, add: function(dx, dy) { return new Point(this.x + dx, this.y + dy); }, mult: function(p) { return p; }}) : { x: number; y: number; add: (dx: number, dy: number) => Point; mult: (p: Point) => Point; }
>{ x: 0, y: 0, add: function(dx, dy) { return new Point(this.x + dx, this.y + dy); }, mult: function(p) { return p; }} : { x: number; y: number; add: (dx: number, dy: number) => Point; mult: (p: Point) => Point; }
2014-08-15 23:33:16 +02:00
x: 0,
2015-04-13 23:01:57 +02:00
>x : number, Symbol(x, Decl(castTest.ts, 22, 23))
2015-04-13 21:36:11 +02:00
>0 : number
2014-08-15 23:33:16 +02:00
y: 0,
2015-04-13 23:01:57 +02:00
>y : number, Symbol(y, Decl(castTest.ts, 23, 9))
2015-04-13 21:36:11 +02:00
>0 : number
2014-08-15 23:33:16 +02:00
add: function(dx, dy) {
2015-04-13 23:01:57 +02:00
>add : (dx: number, dy: number) => Point, Symbol(add, Decl(castTest.ts, 24, 9))
>function(dx, dy) { return new Point(this.x + dx, this.y + dy); } : (dx: number, dy: number) => Point
2015-04-13 23:01:57 +02:00
>dx : number, Symbol(dx, Decl(castTest.ts, 25, 18))
>dy : number, Symbol(dy, Decl(castTest.ts, 25, 21))
2014-08-15 23:33:16 +02:00
return new Point(this.x + dx, this.y + dy);
>new Point(this.x + dx, this.y + dy) : Point
2015-04-13 23:01:57 +02:00
>Point : typeof Point, Symbol(Point, Decl(castTest.ts, 11, 37))
2014-08-15 23:33:16 +02:00
>this.x + dx : any
>this.x : any
>this : any
>x : any
2015-04-13 23:01:57 +02:00
>dx : number, Symbol(dx, Decl(castTest.ts, 25, 18))
2014-08-15 23:33:16 +02:00
>this.y + dy : any
>this.y : any
>this : any
>y : any
2015-04-13 23:01:57 +02:00
>dy : number, Symbol(dy, Decl(castTest.ts, 25, 21))
2014-08-15 23:33:16 +02:00
},
mult: function(p) { return p; }
2015-04-13 23:01:57 +02:00
>mult : (p: Point) => Point, Symbol(mult, Decl(castTest.ts, 27, 6))
>function(p) { return p; } : (p: Point) => Point
2015-04-13 23:01:57 +02:00
>p : Point, Symbol(p, Decl(castTest.ts, 28, 19))
>p : Point, Symbol(p, Decl(castTest.ts, 28, 19))
2014-08-15 23:33:16 +02:00
})