TypeScript/tests/baselines/reference/forStatements.types

165 lines
3.1 KiB
Plaintext
Raw Normal View History

2014-08-15 23:33:16 +02:00
=== tests/cases/conformance/statements/forStatements/forStatements.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
}
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
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
}
for(var aNumber: number = 9.9;;){}
>aNumber : number
2015-04-13 21:36:11 +02:00
>9.9 : number
2014-08-15 23:33:16 +02:00
for(var aString: string = 'this is a string';;){}
>aString : string
2015-04-13 21:36:11 +02:00
>'this is a string' : string
2014-08-15 23:33:16 +02:00
for(var aDate: Date = new Date(12);;){}
>aDate : Date
>Date : Date
2014-08-15 23:33:16 +02:00
>new Date(12) : Date
>Date : DateConstructor
2015-04-13 21:36:11 +02:00
>12 : number
2014-08-15 23:33:16 +02:00
for(var anObject: Object = new Object();;){}
>anObject : Object
>Object : Object
2014-08-15 23:33:16 +02:00
>new Object() : Object
>Object : ObjectConstructor
2014-08-15 23:33:16 +02:00
for(var anAny: any = null;;){}
>anAny : any
2015-04-13 21:36:11 +02:00
>null : null
2014-08-15 23:33:16 +02:00
for(var aSecondAny: any = undefined;;){}
>aSecondAny : any
>undefined : undefined
2014-08-15 23:33:16 +02:00
for(var aVoid: void = undefined;;){}
>aVoid : void
>undefined : undefined
2014-08-15 23:33:16 +02:00
for(var anInterface: I = new C();;){}
>anInterface : I
>I : I
2014-08-15 23:33:16 +02:00
>new C() : C
>C : typeof C
2014-08-15 23:33:16 +02:00
for(var aClass: C = new C();;){}
>aClass : C
>C : C
2014-08-15 23:33:16 +02:00
>new C() : C
>C : typeof C
2014-08-15 23:33:16 +02:00
for(var aGenericClass: D<string> = new D<string>();;){}
>aGenericClass : D<string>
>D : D<T>
2014-08-15 23:33:16 +02:00
>new D<string>() : D<string>
>D : typeof D
2014-08-15 23:33:16 +02:00
for(var anObjectLiteral: I = { id: 12 };;){}
>anObjectLiteral : I
>I : I
2014-08-15 23:33:16 +02:00
>{ id: 12 } : { id: number; }
>id : number
2015-04-13 21:36:11 +02:00
>12 : number
2014-08-15 23:33:16 +02:00
for(var anOtherObjectLiteral: { id: number } = new C();;){}
>anOtherObjectLiteral : { id: number; }
>id : number
2014-08-15 23:33:16 +02:00
>new C() : C
>C : typeof C
2014-08-15 23:33:16 +02:00
for(var aFunction: typeof F = F;;){}
>aFunction : (x: string) => number
>F : (x: string) => number
>F : (x: string) => number
2014-08-15 23:33:16 +02:00
for(var anOtherFunction: (x: string) => number = F;;){}
>anOtherFunction : (x: string) => number
>x : string
>F : (x: string) => number
2014-08-15 23:33:16 +02:00
for(var aLambda: typeof F = (x) => 2;;){}
>aLambda : (x: string) => number
>F : (x: string) => number
2014-08-15 23:33:16 +02:00
>(x) => 2 : (x: string) => number
>x : string
2015-04-13 21:36:11 +02:00
>2 : number
2014-08-15 23:33:16 +02:00
for(var aModule: typeof M = M;;){}
>aModule : typeof M
>M : typeof M
>M : typeof M
2014-08-15 23:33:16 +02:00
for(var aClassInModule: M.A = new M.A();;){}
>aClassInModule : M.A
>M : any
>A : M.A
2014-08-25 19:36:12 +02:00
>new M.A() : M.A
>M.A : typeof M.A
>M : typeof M
>A : typeof M.A
2014-08-15 23:33:16 +02:00
for(var aFunctionInModule: typeof M.F2 = (x) => 'this is a string';;){}
>aFunctionInModule : (x: number) => string
>M.F2 : (x: number) => string
>M : typeof M
>F2 : (x: number) => string
2014-08-15 23:33:16 +02:00
>(x) => 'this is a string' : (x: number) => string
>x : number
2015-04-13 21:36:11 +02:00
>'this is a string' : string
2014-08-15 23:33:16 +02:00