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 149 150
|
tests/cases/compiler/letDeclarations-validContexts.ts(21,1): error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'.
==== tests/cases/compiler/letDeclarations-validContexts.ts (1 errors) ====
// Control flow statements with blocks
if (true) {
let l1 = 0;
}
else {
let l2 = 0;
}
while (true) {
let l3 = 0;
}
do {
let l4 = 0;
} while (true);
var obj;
with (obj) {
~~~~~~~~~~
!!! error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'.
let l5 = 0;
}
for (var i = 0; i < 10; i++) {
let l6 = 0;
}
for (var i2 in {}) {
let l7 = 0;
}
if (true) {
label: let l8 = 0;
}
while (false) {
label2: label3: label4: let l9 = 0;
}
// Try/catch/finally
try {
let l10 = 0;
}
catch (e) {
let l11 = 0;
}
finally {
let l12 = 0;
}
// Switch
switch (0) {
case 0:
let l13 = 0;
break;
default:
let l14 = 0;
break;
}
// blocks
{
let l15 = 0;
{
let l16 = 0
label17: let l17 = 0;
}
}
// global
let l18 = 0;
// functions
function F() {
let l19 = 0;
}
var F2 = () => {
let l20 = 0;
};
var F3 = function () {
let l21 = 0;
};
// modules
module m {
let l22 = 0;
{
let l23 = 0;
}
}
// methods
class C {
constructor() {
let l24 = 0;
}
method() {
let l25 = 0;
}
get v() {
let l26 = 0;
return l26;
}
set v(value) {
let l27 = value;
}
}
// object literals
var o = {
f() {
let l28 = 0;
},
f2: () => {
let l29 = 0;
}
}
// labels
label: let l30 = 0;
{
label2: let l31 = 0;
}
function f3() {
label: let l32 = 0;
{
label2: let l33 = 0;
}
}
module m3 {
label: let l34 = 0;
{
label2: let l35 = 0;
}
}
|