1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148
|
=== tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInitializer.ts ===
interface I {
id: number;
>id : number
}
class C implements I {
>C : C
id: number;
>id : number
}
class D<T>{
>D : D<T>
source: T;
>source : T
recurse: D<T>;
>recurse : D<T>
wrapped: D<D<T>>
>wrapped : D<D<T>>
}
function F(x: string): number { return 42; }
>F : (x: string) => number
>x : string
>42 : 42
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: number = 9.9;
>aNumber : number
>9.9 : 9.9
var aString: string = 'this is a string';
>aString : string
>'this is a string' : "this is a string"
var aDate: Date = new Date(12);
>aDate : Date
>new Date(12) : Date
>Date : DateConstructor
>12 : 12
var anObject: Object = new Object();
>anObject : Object
>new Object() : Object
>Object : ObjectConstructor
var anAny: any = null;
>anAny : any
>null : null
var aSecondAny: any = undefined;
>aSecondAny : any
>undefined : undefined
var aVoid: void = undefined;
>aVoid : void
>undefined : undefined
var anInterface: I = new C();
>anInterface : I
>new C() : C
>C : typeof C
var aClass: C = new C();
>aClass : C
>new C() : C
>C : typeof C
var aGenericClass: D<string> = new D<string>();
>aGenericClass : D<string>
>new D<string>() : D<string>
>D : typeof D
var anObjectLiteral: I = { id: 12 };
>anObjectLiteral : I
>{ id: 12 } : { id: number; }
>id : number
>12 : 12
var anOtherObjectLiteral: { id: number } = new C();
>anOtherObjectLiteral : { id: number; }
>id : number
>new C() : C
>C : typeof C
var aFunction: typeof F = F;
>aFunction : (x: string) => number
>F : (x: string) => number
>F : (x: string) => number
var anOtherFunction: (x: string) => number = F;
>anOtherFunction : (x: string) => number
>x : string
>F : (x: string) => number
var aLambda: typeof F = (x) => 2;
>aLambda : (x: string) => number
>F : (x: string) => number
>(x) => 2 : (x: string) => number
>x : string
>2 : 2
var aModule: typeof M = M;
>aModule : typeof M
>M : typeof M
>M : typeof M
var aClassInModule: M.A = new M.A();
>aClassInModule : M.A
>M : any
>new M.A() : M.A
>M.A : typeof M.A
>M : typeof M
>A : typeof M.A
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
>(x) => 'this is a string' : (x: number) => string
>x : number
>'this is a string' : "this is a string"
|