TypeScript/tests/baselines/reference/everyTypeWithInitializer.types
2014-10-28 21:21:47 -07:00

136 lines
2.2 KiB
Plaintext

=== tests/cases/conformance/statements/VariableStatements/everyTypeWithInitializer.ts ===
interface I {
>I : I
id: number;
>id : number
}
class C implements I {
>C : C
>I : I
id: number;
>id : number
}
class D<T>{
>D : D<T>
>T : T
source: T;
>source : T
>T : T
recurse: D<T>;
>recurse : D<T>
>D : D<T>
>T : T
wrapped: D<D<T>>
>wrapped : D<D<T>>
>D : D<T>
>D : D<T>
>T : T
}
function F(x: string): number { return 42; }
>F : (x: string) => number
>x : string
module M {
>M : typeof M
export class A {
>A : A
name: string;
>name : string
}
export function F2(x: number): string { return x.toString(); }
>F2 : (x: number) => string
>x : number
>x.toString() : string
>x.toString : (radix?: number) => string
>x : number
>toString : (radix?: number) => string
}
var aNumber = 9.9;
>aNumber : number
var aString = 'this is a string';
>aString : string
var aDate = new Date(12);
>aDate : Date
>new Date(12) : Date
>Date : DateConstructor
var anObject = new Object();
>anObject : Object
>new Object() : Object
>Object : ObjectConstructor
var anAny = null;
>anAny : any
var anOtherAny = <any> new C();
>anOtherAny : any
><any> new C() : any
>new C() : C
>C : typeof C
var anUndefined = undefined;
>anUndefined : any
>undefined : undefined
var aClass = new C();
>aClass : C
>new C() : C
>C : typeof C
var aGenericClass = new D<string>();
>aGenericClass : D<string>
>new D<string>() : D<string>
>D : typeof D
var anObjectLiteral = { id: 12 };
>anObjectLiteral : { id: number; }
>{ id: 12 } : { id: number; }
>id : number
var aFunction = F;
>aFunction : (x: string) => number
>F : (x: string) => number
var aLambda = (x) => 2;
>aLambda : (x: any) => number
>(x) => 2 : (x: any) => number
>x : any
var aModule = M;
>aModule : typeof M
>M : typeof M
var aClassInModule = new M.A();
>aClassInModule : M.A
>new M.A() : M.A
>M.A : typeof M.A
>M : typeof M
>A : typeof M.A
var aFunctionInModule = M.F2;
>aFunctionInModule : (x: number) => string
>M.F2 : (x: number) => string
>M : typeof M
>F2 : (x: number) => string
// no initializer or annotation, so this is an 'any'
var x;
>x : any