TypeScript/tests/baselines/reference/ifDoWhileStatements.types

434 lines
5.6 KiB
Plaintext
Raw Normal View History

2014-08-15 23:33:16 +02:00
=== tests/cases/conformance/statements/ifDoWhileStatements/ifDoWhileStatements.ts ===
interface I {
>I : I
2014-08-15 23:33:16 +02:00
id: number;
>id : number
2014-08-15 23:33:16 +02:00
}
class C implements I {
>C : C
>I : I
2014-08-15 23:33:16 +02:00
id: number;
>id : number
2014-08-15 23:33:16 +02:00
name: string;
>name : string
2014-08-15 23:33:16 +02:00
}
class C2 extends C {
>C2 : C2
>C : C
2014-08-15 23:33:16 +02:00
valid: boolean;
>valid : boolean
2014-08-15 23:33:16 +02:00
}
class D<T>{
>D : D<T>
>T : T
2014-08-15 23:33:16 +02:00
source: T;
>source : T
>T : T
2014-08-15 23:33:16 +02:00
recurse: D<T>;
>recurse : D<T>
>D : D<T>
>T : T
2014-08-15 23:33:16 +02:00
wrapped: D<D<T>>
>wrapped : D<D<T>>
>D : D<T>
>D : D<T>
>T : T
2014-08-15 23:33:16 +02:00
}
function F(x: string): number { return 42; }
>F : (x: string) => number
>x : string
2015-04-13 21:36:11 +02:00
>42 : number
2014-08-15 23:33:16 +02:00
function F2(x: number): boolean { return x < 42; }
>F2 : (x: number) => boolean
>x : number
2014-08-15 23:33:16 +02:00
>x < 42 : boolean
>x : number
2015-04-13 21:36:11 +02:00
>42 : number
2014-08-15 23:33:16 +02:00
module M {
>M : typeof M
2014-08-15 23:33:16 +02:00
export class A {
>A : A
2014-08-15 23:33:16 +02:00
name: string;
>name : string
2014-08-15 23:33:16 +02:00
}
export function F2(x: number): string { return x.toString(); }
>F2 : (x: number) => string
>x : number
2014-08-15 23:33:16 +02:00
>x.toString() : string
>x.toString : (radix?: number) => string
>x : number
>toString : (radix?: number) => string
2014-08-15 23:33:16 +02:00
}
module N {
>N : typeof N
2014-08-15 23:33:16 +02:00
export class A {
>A : A
2014-08-15 23:33:16 +02:00
id: number;
>id : number
2014-08-15 23:33:16 +02:00
}
export function F2(x: number): string { return x.toString(); }
>F2 : (x: number) => string
>x : number
2014-08-15 23:33:16 +02:00
>x.toString() : string
>x.toString : (radix?: number) => string
>x : number
>toString : (radix?: number) => string
2014-08-15 23:33:16 +02:00
}
// literals
if (true) { }
2015-04-13 21:36:11 +02:00
>true : boolean
2014-08-15 23:33:16 +02:00
while (true) { }
2015-04-13 21:36:11 +02:00
>true : boolean
2014-08-15 23:33:16 +02:00
do { }while(true)
2015-04-13 21:36:11 +02:00
>true : boolean
2014-08-15 23:33:16 +02:00
if (null) { }
2015-04-13 21:36:11 +02:00
>null : null
2014-08-15 23:33:16 +02:00
while (null) { }
2015-04-13 21:36:11 +02:00
>null : null
2014-08-15 23:33:16 +02:00
do { }while(null)
2015-04-13 21:36:11 +02:00
>null : null
2014-08-15 23:33:16 +02:00
if (undefined) { }
>undefined : undefined
2014-08-15 23:33:16 +02:00
while (undefined) { }
>undefined : undefined
2014-08-15 23:33:16 +02:00
do { }while(undefined)
>undefined : undefined
2014-08-15 23:33:16 +02:00
if (0.0) { }
2015-04-13 21:36:11 +02:00
>0.0 : number
2014-08-15 23:33:16 +02:00
while (0.0) { }
2015-04-13 21:36:11 +02:00
>0.0 : number
2014-08-15 23:33:16 +02:00
do { }while(0.0)
2015-04-13 21:36:11 +02:00
>0.0 : number
2014-08-15 23:33:16 +02:00
if ('a string') { }
2015-04-13 21:36:11 +02:00
>'a string' : string
2014-08-15 23:33:16 +02:00
while ('a string') { }
2015-04-13 21:36:11 +02:00
>'a string' : string
2014-08-15 23:33:16 +02:00
do { }while('a string')
2015-04-13 21:36:11 +02:00
>'a string' : string
2014-08-15 23:33:16 +02:00
if ('') { }
2015-04-13 21:36:11 +02:00
>'' : string
2014-08-15 23:33:16 +02:00
while ('') { }
2015-04-13 21:36:11 +02:00
>'' : string
2014-08-15 23:33:16 +02:00
do { }while('')
2015-04-13 21:36:11 +02:00
>'' : string
2014-08-15 23:33:16 +02:00
if (/[a-z]/) { }
2015-04-13 21:36:11 +02:00
>/[a-z]/ : RegExp
2014-08-15 23:33:16 +02:00
while (/[a-z]/) { }
2015-04-13 21:36:11 +02:00
>/[a-z]/ : RegExp
2014-08-15 23:33:16 +02:00
do { }while(/[a-z]/)
2015-04-13 21:36:11 +02:00
>/[a-z]/ : RegExp
2014-08-15 23:33:16 +02:00
if ([]) { }
>[] : undefined[]
while ([]) { }
>[] : undefined[]
do { }while([])
>[] : undefined[]
if ([1, 2]) { }
>[1, 2] : number[]
2015-04-13 21:36:11 +02:00
>1 : number
>2 : number
2014-08-15 23:33:16 +02:00
while ([1, 2]) { }
>[1, 2] : number[]
2015-04-13 21:36:11 +02:00
>1 : number
>2 : number
2014-08-15 23:33:16 +02:00
do { }while([1, 2])
>[1, 2] : number[]
2015-04-13 21:36:11 +02:00
>1 : number
>2 : number
2014-08-15 23:33:16 +02:00
if ({}) { }
>{} : {}
while ({}) { }
>{} : {}
do { }while({})
>{} : {}
if ({ x: 1, y: 'a' }) { }
>{ x: 1, y: 'a' } : { x: number; y: string; }
>x : number
2015-04-13 21:36:11 +02:00
>1 : number
>y : string
2015-04-13 21:36:11 +02:00
>'a' : string
2014-08-15 23:33:16 +02:00
while ({ x: 1, y: 'a' }) { }
>{ x: 1, y: 'a' } : { x: number; y: string; }
>x : number
2015-04-13 21:36:11 +02:00
>1 : number
>y : string
2015-04-13 21:36:11 +02:00
>'a' : string
2014-08-15 23:33:16 +02:00
do { }while({ x: 1, y: 'a' })
>{ x: 1, y: 'a' } : { x: number; y: string; }
>x : number
2015-04-13 21:36:11 +02:00
>1 : number
>y : string
2015-04-13 21:36:11 +02:00
>'a' : string
2014-08-15 23:33:16 +02:00
if (() => 43) { }
>() => 43 : () => number
2015-04-13 21:36:11 +02:00
>43 : number
2014-08-15 23:33:16 +02:00
while (() => 43) { }
>() => 43 : () => number
2015-04-13 21:36:11 +02:00
>43 : number
2014-08-15 23:33:16 +02:00
do { }while(() => 43)
>() => 43 : () => number
2015-04-13 21:36:11 +02:00
>43 : number
2014-08-15 23:33:16 +02:00
if (new C()) { }
>new C() : C
>C : typeof C
2014-08-15 23:33:16 +02:00
while (new C()) { }
>new C() : C
>C : typeof C
2014-08-15 23:33:16 +02:00
do { }while(new C())
>new C() : C
>C : typeof C
2014-08-15 23:33:16 +02:00
if (new D<C>()) { }
>new D<C>() : D<C>
>D : typeof D
>C : C
2014-08-15 23:33:16 +02:00
while (new D<C>()) { }
>new D<C>() : D<C>
>D : typeof D
>C : C
2014-08-15 23:33:16 +02:00
do { }while(new D<C>())
>new D<C>() : D<C>
>D : typeof D
>C : C
2014-08-15 23:33:16 +02:00
// references
var a = true;
>a : boolean
2015-04-13 21:36:11 +02:00
>true : boolean
2014-08-15 23:33:16 +02:00
if (a) { }
>a : boolean
2014-08-15 23:33:16 +02:00
while (a) { }
>a : boolean
2014-08-15 23:33:16 +02:00
do { }while(a)
>a : boolean
2014-08-15 23:33:16 +02:00
var b = null;
>b : any
2015-04-13 21:36:11 +02:00
>null : null
2014-08-15 23:33:16 +02:00
if (b) { }
>b : any
2014-08-15 23:33:16 +02:00
while (b) { }
>b : any
2014-08-15 23:33:16 +02:00
do { }while(b)
>b : any
2014-08-15 23:33:16 +02:00
var c = undefined;
>c : any
>undefined : undefined
2014-08-15 23:33:16 +02:00
if (c) { }
>c : any
2014-08-15 23:33:16 +02:00
while (c) { }
>c : any
2014-08-15 23:33:16 +02:00
do { }while(c)
>c : any
2014-08-15 23:33:16 +02:00
var d = 0.0;
>d : number
2015-04-13 21:36:11 +02:00
>0.0 : number
2014-08-15 23:33:16 +02:00
if (d) { }
>d : number
2014-08-15 23:33:16 +02:00
while (d) { }
>d : number
2014-08-15 23:33:16 +02:00
do { }while(d)
>d : number
2014-08-15 23:33:16 +02:00
var e = 'a string';
>e : string
2015-04-13 21:36:11 +02:00
>'a string' : string
2014-08-15 23:33:16 +02:00
if (e) { }
>e : string
2014-08-15 23:33:16 +02:00
while (e) { }
>e : string
2014-08-15 23:33:16 +02:00
do { }while(e)
>e : string
2014-08-15 23:33:16 +02:00
var f = '';
>f : string
2015-04-13 21:36:11 +02:00
>'' : string
2014-08-15 23:33:16 +02:00
if (f) { }
>f : string
2014-08-15 23:33:16 +02:00
while (f) { }
>f : string
2014-08-15 23:33:16 +02:00
do { }while(f)
>f : string
2014-08-15 23:33:16 +02:00
var g = /[a-z]/
>g : RegExp
2015-04-13 21:36:11 +02:00
>/[a-z]/ : RegExp
2014-08-15 23:33:16 +02:00
if (g) { }
>g : RegExp
2014-08-15 23:33:16 +02:00
while (g) { }
>g : RegExp
2014-08-15 23:33:16 +02:00
do { }while(g)
>g : RegExp
2014-08-15 23:33:16 +02:00
var h = [];
>h : any[]
2014-08-15 23:33:16 +02:00
>[] : undefined[]
if (h) { }
>h : any[]
2014-08-15 23:33:16 +02:00
while (h) { }
>h : any[]
2014-08-15 23:33:16 +02:00
do { }while(h)
>h : any[]
2014-08-15 23:33:16 +02:00
var i = [1, 2];
>i : number[]
2014-08-15 23:33:16 +02:00
>[1, 2] : number[]
2015-04-13 21:36:11 +02:00
>1 : number
>2 : number
2014-08-15 23:33:16 +02:00
if (i) { }
>i : number[]
2014-08-15 23:33:16 +02:00
while (i) { }
>i : number[]
2014-08-15 23:33:16 +02:00
do { }while(i)
>i : number[]
2014-08-15 23:33:16 +02:00
var j = {};
>j : {}
2014-08-15 23:33:16 +02:00
>{} : {}
if (j) { }
>j : {}
2014-08-15 23:33:16 +02:00
while (j) { }
>j : {}
2014-08-15 23:33:16 +02:00
do { }while(j)
>j : {}
2014-08-15 23:33:16 +02:00
var k = { x: 1, y: 'a' };
>k : { x: number; y: string; }
2014-08-15 23:33:16 +02:00
>{ x: 1, y: 'a' } : { x: number; y: string; }
>x : number
2015-04-13 21:36:11 +02:00
>1 : number
>y : string
2015-04-13 21:36:11 +02:00
>'a' : string
2014-08-15 23:33:16 +02:00
if (k) { }
>k : { x: number; y: string; }
2014-08-15 23:33:16 +02:00
while (k) { }
>k : { x: number; y: string; }
2014-08-15 23:33:16 +02:00
do { }while(k)
>k : { x: number; y: string; }
2014-08-15 23:33:16 +02:00
function fn(x?: string): I { return null; }
>fn : (x?: string) => I
>x : string
>I : I
2015-04-13 21:36:11 +02:00
>null : null
2014-08-15 23:33:16 +02:00
if (fn()) { }
>fn() : I
>fn : (x?: string) => I
2014-08-15 23:33:16 +02:00
while (fn()) { }
>fn() : I
>fn : (x?: string) => I
2014-08-15 23:33:16 +02:00
do { }while(fn())
>fn() : I
>fn : (x?: string) => I
2014-08-15 23:33:16 +02:00
if (fn) { }
>fn : (x?: string) => I
2014-08-15 23:33:16 +02:00
while (fn) { }
>fn : (x?: string) => I
2014-08-15 23:33:16 +02:00
do { }while(fn)
>fn : (x?: string) => I
2014-08-15 23:33:16 +02:00