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
|
=== tests/cases/compiler/constDeclarations-access3.ts ===
module M {
>M : Symbol(M, Decl(constDeclarations-access3.ts, 0, 0))
export const x = 0;
>x : Symbol(x, Decl(constDeclarations-access3.ts, 1, 16))
}
// Errors
M.x = 1;
>M.x : Symbol(M.x, Decl(constDeclarations-access3.ts, 1, 16))
>M : Symbol(M, Decl(constDeclarations-access3.ts, 0, 0))
>x : Symbol(M.x, Decl(constDeclarations-access3.ts, 1, 16))
M.x += 2;
>M.x : Symbol(M.x, Decl(constDeclarations-access3.ts, 1, 16))
>M : Symbol(M, Decl(constDeclarations-access3.ts, 0, 0))
>x : Symbol(M.x, Decl(constDeclarations-access3.ts, 1, 16))
M.x -= 3;
>M.x : Symbol(M.x, Decl(constDeclarations-access3.ts, 1, 16))
>M : Symbol(M, Decl(constDeclarations-access3.ts, 0, 0))
>x : Symbol(M.x, Decl(constDeclarations-access3.ts, 1, 16))
M.x *= 4;
>M.x : Symbol(M.x, Decl(constDeclarations-access3.ts, 1, 16))
>M : Symbol(M, Decl(constDeclarations-access3.ts, 0, 0))
>x : Symbol(M.x, Decl(constDeclarations-access3.ts, 1, 16))
M.x /= 5;
>M.x : Symbol(M.x, Decl(constDeclarations-access3.ts, 1, 16))
>M : Symbol(M, Decl(constDeclarations-access3.ts, 0, 0))
>x : Symbol(M.x, Decl(constDeclarations-access3.ts, 1, 16))
M.x %= 6;
>M.x : Symbol(M.x, Decl(constDeclarations-access3.ts, 1, 16))
>M : Symbol(M, Decl(constDeclarations-access3.ts, 0, 0))
>x : Symbol(M.x, Decl(constDeclarations-access3.ts, 1, 16))
M.x <<= 7;
>M.x : Symbol(M.x, Decl(constDeclarations-access3.ts, 1, 16))
>M : Symbol(M, Decl(constDeclarations-access3.ts, 0, 0))
>x : Symbol(M.x, Decl(constDeclarations-access3.ts, 1, 16))
M.x >>= 8;
>M.x : Symbol(M.x, Decl(constDeclarations-access3.ts, 1, 16))
>M : Symbol(M, Decl(constDeclarations-access3.ts, 0, 0))
>x : Symbol(M.x, Decl(constDeclarations-access3.ts, 1, 16))
M.x >>>= 9;
>M.x : Symbol(M.x, Decl(constDeclarations-access3.ts, 1, 16))
>M : Symbol(M, Decl(constDeclarations-access3.ts, 0, 0))
>x : Symbol(M.x, Decl(constDeclarations-access3.ts, 1, 16))
M.x &= 10;
>M.x : Symbol(M.x, Decl(constDeclarations-access3.ts, 1, 16))
>M : Symbol(M, Decl(constDeclarations-access3.ts, 0, 0))
>x : Symbol(M.x, Decl(constDeclarations-access3.ts, 1, 16))
M.x |= 11;
>M.x : Symbol(M.x, Decl(constDeclarations-access3.ts, 1, 16))
>M : Symbol(M, Decl(constDeclarations-access3.ts, 0, 0))
>x : Symbol(M.x, Decl(constDeclarations-access3.ts, 1, 16))
M.x ^= 12;
>M.x : Symbol(M.x, Decl(constDeclarations-access3.ts, 1, 16))
>M : Symbol(M, Decl(constDeclarations-access3.ts, 0, 0))
>x : Symbol(M.x, Decl(constDeclarations-access3.ts, 1, 16))
M.x++;
>M.x : Symbol(M.x, Decl(constDeclarations-access3.ts, 1, 16))
>M : Symbol(M, Decl(constDeclarations-access3.ts, 0, 0))
>x : Symbol(M.x, Decl(constDeclarations-access3.ts, 1, 16))
M.x--;
>M.x : Symbol(M.x, Decl(constDeclarations-access3.ts, 1, 16))
>M : Symbol(M, Decl(constDeclarations-access3.ts, 0, 0))
>x : Symbol(M.x, Decl(constDeclarations-access3.ts, 1, 16))
++M.x;
>M.x : Symbol(M.x, Decl(constDeclarations-access3.ts, 1, 16))
>M : Symbol(M, Decl(constDeclarations-access3.ts, 0, 0))
>x : Symbol(M.x, Decl(constDeclarations-access3.ts, 1, 16))
--M.x;
>M.x : Symbol(M.x, Decl(constDeclarations-access3.ts, 1, 16))
>M : Symbol(M, Decl(constDeclarations-access3.ts, 0, 0))
>x : Symbol(M.x, Decl(constDeclarations-access3.ts, 1, 16))
++((M.x));
>M.x : Symbol(M.x, Decl(constDeclarations-access3.ts, 1, 16))
>M : Symbol(M, Decl(constDeclarations-access3.ts, 0, 0))
>x : Symbol(M.x, Decl(constDeclarations-access3.ts, 1, 16))
M["x"] = 0;
>M : Symbol(M, Decl(constDeclarations-access3.ts, 0, 0))
>"x" : Symbol(M.x, Decl(constDeclarations-access3.ts, 1, 16))
// OK
var a = M.x + 1;
>a : Symbol(a, Decl(constDeclarations-access3.ts, 28, 3))
>M.x : Symbol(M.x, Decl(constDeclarations-access3.ts, 1, 16))
>M : Symbol(M, Decl(constDeclarations-access3.ts, 0, 0))
>x : Symbol(M.x, Decl(constDeclarations-access3.ts, 1, 16))
function f(v: number) { }
>f : Symbol(f, Decl(constDeclarations-access3.ts, 28, 16))
>v : Symbol(v, Decl(constDeclarations-access3.ts, 30, 11))
f(M.x);
>f : Symbol(f, Decl(constDeclarations-access3.ts, 28, 16))
>M.x : Symbol(M.x, Decl(constDeclarations-access3.ts, 1, 16))
>M : Symbol(M, Decl(constDeclarations-access3.ts, 0, 0))
>x : Symbol(M.x, Decl(constDeclarations-access3.ts, 1, 16))
if (M.x) { }
>M.x : Symbol(M.x, Decl(constDeclarations-access3.ts, 1, 16))
>M : Symbol(M, Decl(constDeclarations-access3.ts, 0, 0))
>x : Symbol(M.x, Decl(constDeclarations-access3.ts, 1, 16))
M.x;
>M.x : Symbol(M.x, Decl(constDeclarations-access3.ts, 1, 16))
>M : Symbol(M, Decl(constDeclarations-access3.ts, 0, 0))
>x : Symbol(M.x, Decl(constDeclarations-access3.ts, 1, 16))
(M.x);
>M.x : Symbol(M.x, Decl(constDeclarations-access3.ts, 1, 16))
>M : Symbol(M, Decl(constDeclarations-access3.ts, 0, 0))
>x : Symbol(M.x, Decl(constDeclarations-access3.ts, 1, 16))
-M.x;
>M.x : Symbol(M.x, Decl(constDeclarations-access3.ts, 1, 16))
>M : Symbol(M, Decl(constDeclarations-access3.ts, 0, 0))
>x : Symbol(M.x, Decl(constDeclarations-access3.ts, 1, 16))
+M.x;
>M.x : Symbol(M.x, Decl(constDeclarations-access3.ts, 1, 16))
>M : Symbol(M, Decl(constDeclarations-access3.ts, 0, 0))
>x : Symbol(M.x, Decl(constDeclarations-access3.ts, 1, 16))
M.x.toString();
>M.x.toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --))
>M.x : Symbol(M.x, Decl(constDeclarations-access3.ts, 1, 16))
>M : Symbol(M, Decl(constDeclarations-access3.ts, 0, 0))
>x : Symbol(M.x, Decl(constDeclarations-access3.ts, 1, 16))
>toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --))
|