TypeScript/tests/baselines/reference/null.types

60 lines
1.1 KiB
Plaintext
Raw Normal View History

2014-08-15 23:33:16 +02:00
=== tests/cases/compiler/null.ts ===
var x=null;
2015-04-13 23:01:57 +02:00
>x : any, Symbol(x, Decl(null.ts, 0, 3))
2015-04-13 21:36:11 +02:00
>null : null
2014-08-15 23:33:16 +02:00
var y=3+x;
2015-04-13 23:01:57 +02:00
>y : any, Symbol(y, Decl(null.ts, 1, 3))
2014-08-15 23:33:16 +02:00
>3+x : any
2015-04-13 21:36:11 +02:00
>3 : number
2015-04-13 23:01:57 +02:00
>x : any, Symbol(x, Decl(null.ts, 0, 3))
2014-08-15 23:33:16 +02:00
var z=3+null;
2015-04-13 23:01:57 +02:00
>z : number, Symbol(z, Decl(null.ts, 2, 3))
2014-08-15 23:33:16 +02:00
>3+null : number
2015-04-13 21:36:11 +02:00
>3 : number
>null : null
2014-08-15 23:33:16 +02:00
class C {
2015-04-13 23:01:57 +02:00
>C : C, Symbol(C, Decl(null.ts, 2, 13))
2014-08-15 23:33:16 +02:00
}
function f() {
2015-04-13 23:01:57 +02:00
>f : () => C, Symbol(f, Decl(null.ts, 4, 1))
2014-08-15 23:33:16 +02:00
return null;
2015-04-13 21:36:11 +02:00
>null : null
2014-08-15 23:33:16 +02:00
return new C();
>new C() : C
2015-04-13 23:01:57 +02:00
>C : typeof C, Symbol(C, Decl(null.ts, 2, 13))
2014-08-15 23:33:16 +02:00
}
function g() {
2015-04-13 23:01:57 +02:00
>g : () => number, Symbol(g, Decl(null.ts, 8, 1))
2014-08-15 23:33:16 +02:00
return null;
2015-04-13 21:36:11 +02:00
>null : null
2014-08-15 23:33:16 +02:00
return 3;
2015-04-13 21:36:11 +02:00
>3 : number
2014-08-15 23:33:16 +02:00
}
interface I {
2015-04-13 23:01:57 +02:00
>I : I, Symbol(I, Decl(null.ts, 12, 1))
2014-08-15 23:33:16 +02:00
x:any;
2015-04-13 23:01:57 +02:00
>x : any, Symbol(x, Decl(null.ts, 13, 13))
2014-08-15 23:33:16 +02:00
y:number;
2015-04-13 23:01:57 +02:00
>y : number, Symbol(y, Decl(null.ts, 14, 10))
2014-08-15 23:33:16 +02:00
}
var w:I={x:null,y:3};
2015-04-13 23:01:57 +02:00
>w : I, Symbol(w, Decl(null.ts, 17, 3))
>I : I, Symbol(I, Decl(null.ts, 12, 1))
2014-08-15 23:33:16 +02:00
>{x:null,y:3} : { x: null; y: number; }
2015-04-13 23:01:57 +02:00
>x : null, Symbol(x, Decl(null.ts, 17, 9))
2015-04-13 21:36:11 +02:00
>null : null
2015-04-13 23:01:57 +02:00
>y : number, Symbol(y, Decl(null.ts, 17, 16))
2015-04-13 21:36:11 +02:00
>3 : number
2014-08-15 23:33:16 +02:00