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