167 lines
4.7 KiB
Text
167 lines
4.7 KiB
Text
=== tests/cases/conformance/types/any/assignEveryTypeToAny.ts ===
|
|
// all of these are valid
|
|
|
|
var x: any;
|
|
>x : any, Symbol(x,Decl(assignEveryTypeToAny.ts,2,3))
|
|
|
|
x = 1;
|
|
>x = 1 : number
|
|
>x : any, Symbol(x,Decl(assignEveryTypeToAny.ts,2,3))
|
|
>1 : number
|
|
|
|
var a = 2;
|
|
>a : number, Symbol(a,Decl(assignEveryTypeToAny.ts,5,3))
|
|
>2 : number
|
|
|
|
x = a;
|
|
>x = a : number
|
|
>x : any, Symbol(x,Decl(assignEveryTypeToAny.ts,2,3))
|
|
>a : number, Symbol(a,Decl(assignEveryTypeToAny.ts,5,3))
|
|
|
|
x = true;
|
|
>x = true : boolean
|
|
>x : any, Symbol(x,Decl(assignEveryTypeToAny.ts,2,3))
|
|
>true : boolean
|
|
|
|
var b = true;
|
|
>b : boolean, Symbol(b,Decl(assignEveryTypeToAny.ts,9,3))
|
|
>true : boolean
|
|
|
|
x = b;
|
|
>x = b : boolean
|
|
>x : any, Symbol(x,Decl(assignEveryTypeToAny.ts,2,3))
|
|
>b : boolean, Symbol(b,Decl(assignEveryTypeToAny.ts,9,3))
|
|
|
|
x = "";
|
|
>x = "" : string
|
|
>x : any, Symbol(x,Decl(assignEveryTypeToAny.ts,2,3))
|
|
>"" : string
|
|
|
|
var c = "";
|
|
>c : string, Symbol(c,Decl(assignEveryTypeToAny.ts,13,3))
|
|
>"" : string
|
|
|
|
x = c;
|
|
>x = c : string
|
|
>x : any, Symbol(x,Decl(assignEveryTypeToAny.ts,2,3))
|
|
>c : string, Symbol(c,Decl(assignEveryTypeToAny.ts,13,3))
|
|
|
|
var d: void;
|
|
>d : void, Symbol(d,Decl(assignEveryTypeToAny.ts,16,3))
|
|
|
|
x = d;
|
|
>x = d : void
|
|
>x : any, Symbol(x,Decl(assignEveryTypeToAny.ts,2,3))
|
|
>d : void, Symbol(d,Decl(assignEveryTypeToAny.ts,16,3))
|
|
|
|
var e = undefined;
|
|
>e : any, Symbol(e,Decl(assignEveryTypeToAny.ts,19,3))
|
|
>undefined : undefined, Symbol(undefined)
|
|
|
|
x = e;
|
|
>x = e : any
|
|
>x : any, Symbol(x,Decl(assignEveryTypeToAny.ts,2,3))
|
|
>e : any, Symbol(e,Decl(assignEveryTypeToAny.ts,19,3))
|
|
|
|
var e2: typeof undefined;
|
|
>e2 : any, Symbol(e2,Decl(assignEveryTypeToAny.ts,22,3))
|
|
>undefined : undefined, Symbol(undefined)
|
|
|
|
x = e2;
|
|
>x = e2 : any
|
|
>x : any, Symbol(x,Decl(assignEveryTypeToAny.ts,2,3))
|
|
>e2 : any, Symbol(e2,Decl(assignEveryTypeToAny.ts,22,3))
|
|
|
|
enum E {
|
|
>E : E, Symbol(E,Decl(assignEveryTypeToAny.ts,23,7))
|
|
|
|
A
|
|
>A : E, Symbol(E.A,Decl(assignEveryTypeToAny.ts,25,8))
|
|
}
|
|
|
|
x = E.A;
|
|
>x = E.A : E
|
|
>x : any, Symbol(x,Decl(assignEveryTypeToAny.ts,2,3))
|
|
>E.A : E, Symbol(E.A,Decl(assignEveryTypeToAny.ts,25,8))
|
|
>E : typeof E, Symbol(E,Decl(assignEveryTypeToAny.ts,23,7))
|
|
>A : E, Symbol(E.A,Decl(assignEveryTypeToAny.ts,25,8))
|
|
|
|
var f = E.A;
|
|
>f : E, Symbol(f,Decl(assignEveryTypeToAny.ts,30,3))
|
|
>E.A : E, Symbol(E.A,Decl(assignEveryTypeToAny.ts,25,8))
|
|
>E : typeof E, Symbol(E,Decl(assignEveryTypeToAny.ts,23,7))
|
|
>A : E, Symbol(E.A,Decl(assignEveryTypeToAny.ts,25,8))
|
|
|
|
x = f;
|
|
>x = f : E
|
|
>x : any, Symbol(x,Decl(assignEveryTypeToAny.ts,2,3))
|
|
>f : E, Symbol(f,Decl(assignEveryTypeToAny.ts,30,3))
|
|
|
|
interface I {
|
|
>I : I, Symbol(I,Decl(assignEveryTypeToAny.ts,31,6))
|
|
|
|
foo: string;
|
|
>foo : string, Symbol(foo,Decl(assignEveryTypeToAny.ts,33,13))
|
|
}
|
|
|
|
var g: I;
|
|
>g : I, Symbol(g,Decl(assignEveryTypeToAny.ts,37,3))
|
|
>I : I, Symbol(I,Decl(assignEveryTypeToAny.ts,31,6))
|
|
|
|
x = g;
|
|
>x = g : I
|
|
>x : any, Symbol(x,Decl(assignEveryTypeToAny.ts,2,3))
|
|
>g : I, Symbol(g,Decl(assignEveryTypeToAny.ts,37,3))
|
|
|
|
class C {
|
|
>C : C, Symbol(C,Decl(assignEveryTypeToAny.ts,38,6))
|
|
|
|
bar: string;
|
|
>bar : string, Symbol(bar,Decl(assignEveryTypeToAny.ts,40,9))
|
|
}
|
|
|
|
var h: C;
|
|
>h : C, Symbol(h,Decl(assignEveryTypeToAny.ts,44,3))
|
|
>C : C, Symbol(C,Decl(assignEveryTypeToAny.ts,38,6))
|
|
|
|
x = h;
|
|
>x = h : C
|
|
>x : any, Symbol(x,Decl(assignEveryTypeToAny.ts,2,3))
|
|
>h : C, Symbol(h,Decl(assignEveryTypeToAny.ts,44,3))
|
|
|
|
var i: { (): string };
|
|
>i : () => string, Symbol(i,Decl(assignEveryTypeToAny.ts,47,3))
|
|
|
|
x = i;
|
|
>x = i : () => string
|
|
>x : any, Symbol(x,Decl(assignEveryTypeToAny.ts,2,3))
|
|
>i : () => string, Symbol(i,Decl(assignEveryTypeToAny.ts,47,3))
|
|
|
|
x = { f() { return 1; } }
|
|
>x = { f() { return 1; } } : { f(): number; }
|
|
>x : any, Symbol(x,Decl(assignEveryTypeToAny.ts,2,3))
|
|
>{ f() { return 1; } } : { f(): number; }
|
|
>f : () => number, Symbol(f,Decl(assignEveryTypeToAny.ts,49,5))
|
|
>1 : number
|
|
|
|
x = { f<T>(x: T) { return x; } }
|
|
>x = { f<T>(x: T) { return x; } } : { f<T>(x: T): T; }
|
|
>x : any, Symbol(x,Decl(assignEveryTypeToAny.ts,2,3))
|
|
>{ f<T>(x: T) { return x; } } : { f<T>(x: T): T; }
|
|
>f : <T>(x: T) => T, Symbol(f,Decl(assignEveryTypeToAny.ts,50,5))
|
|
>T : T, Symbol(T,Decl(assignEveryTypeToAny.ts,50,8))
|
|
>x : T, Symbol(x,Decl(assignEveryTypeToAny.ts,50,11))
|
|
>T : T, Symbol(T,Decl(assignEveryTypeToAny.ts,50,8))
|
|
>x : T, Symbol(x,Decl(assignEveryTypeToAny.ts,50,11))
|
|
|
|
function j<T>(a: T) {
|
|
>j : <T>(a: T) => void, Symbol(j,Decl(assignEveryTypeToAny.ts,50,32))
|
|
>T : T, Symbol(T,Decl(assignEveryTypeToAny.ts,52,11))
|
|
>a : T, Symbol(a,Decl(assignEveryTypeToAny.ts,52,14))
|
|
>T : T, Symbol(T,Decl(assignEveryTypeToAny.ts,52,11))
|
|
|
|
x = a;
|
|
>x = a : T
|
|
>x : any, Symbol(x,Decl(assignEveryTypeToAny.ts,2,3))
|
|
>a : T, Symbol(a,Decl(assignEveryTypeToAny.ts,52,14))
|
|
}
|