|
1 | 1 | awaitUsingDeclarations.1.ts(1,1): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. |
2 | 2 | awaitUsingDeclarations.1.ts(36,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. |
3 | 3 | awaitUsingDeclarations.1.ts(41,9): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. |
4 | | -awaitUsingDeclarations.1.ts(45,9): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. |
5 | | -awaitUsingDeclarations.1.ts(52,13): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. |
6 | | -awaitUsingDeclarations.1.ts(57,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. |
7 | | -awaitUsingDeclarations.1.ts(60,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. |
8 | | -awaitUsingDeclarations.1.ts(63,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. |
9 | | -awaitUsingDeclarations.1.ts(67,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. |
10 | | -awaitUsingDeclarations.1.ts(70,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. |
| 4 | +awaitUsingDeclarations.1.ts(46,9): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. |
| 5 | +awaitUsingDeclarations.1.ts(51,9): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. |
| 6 | +awaitUsingDeclarations.1.ts(58,13): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. |
| 7 | +awaitUsingDeclarations.1.ts(63,13): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. |
| 8 | +awaitUsingDeclarations.1.ts(68,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. |
| 9 | +awaitUsingDeclarations.1.ts(71,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. |
11 | 10 | awaitUsingDeclarations.1.ts(74,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. |
12 | | -awaitUsingDeclarations.1.ts(79,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. |
| 11 | +awaitUsingDeclarations.1.ts(78,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. |
| 12 | +awaitUsingDeclarations.1.ts(81,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. |
13 | 13 | awaitUsingDeclarations.1.ts(85,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. |
14 | 14 | awaitUsingDeclarations.1.ts(90,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. |
15 | | -awaitUsingDeclarations.1.ts(94,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. |
| 15 | +awaitUsingDeclarations.1.ts(96,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. |
| 16 | +awaitUsingDeclarations.1.ts(101,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. |
| 17 | +awaitUsingDeclarations.1.ts(105,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. |
16 | 18 |
|
17 | 19 |
|
18 | | -==== awaitUsingDeclarations.1.ts (15 errors) ==== |
| 20 | +==== awaitUsingDeclarations.1.ts (17 errors) ==== |
19 | 21 | await using d1 = { async [Symbol.asyncDispose]() {} }; |
20 | 22 | ~~~~~ |
21 | 23 | !!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. |
@@ -59,85 +61,100 @@ awaitUsingDeclarations.1.ts(94,5): error TS2854: Top-level 'await using' stateme |
59 | 61 | } |
60 | 62 |
|
61 | 63 | switch (Math.random()) { |
62 | | - case 0: |
| 64 | + case 0: { |
63 | 65 | await using d20 = { async [Symbol.asyncDispose]() {} }; |
64 | 66 | ~~~~~ |
65 | 67 | !!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. |
66 | 68 | break; |
| 69 | + } |
67 | 70 |
|
68 | | - case 1: |
| 71 | + case 1: { |
69 | 72 | await using d21 = { async [Symbol.asyncDispose]() {} }; |
70 | 73 | ~~~~~ |
71 | 74 | !!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. |
72 | 75 | break; |
| 76 | + } |
| 77 | + |
| 78 | + default: { |
| 79 | + await using d22 = { async [Symbol.asyncDispose]() {} }; |
| 80 | + ~~~~~ |
| 81 | +!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. |
| 82 | + } |
73 | 83 | } |
74 | 84 |
|
75 | 85 | if (true) |
76 | 86 | switch (0) { |
77 | | - case 0: |
78 | | - await using d22 = { async [Symbol.asyncDispose]() {} }; |
| 87 | + case 0: { |
| 88 | + await using d23 = { async [Symbol.asyncDispose]() {} }; |
79 | 89 | ~~~~~ |
80 | 90 | !!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. |
81 | 91 | break; |
| 92 | + } |
| 93 | + |
| 94 | + default: { |
| 95 | + await using d24 = { async [Symbol.asyncDispose]() {} }; |
| 96 | + ~~~~~ |
| 97 | +!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. |
| 98 | + } |
82 | 99 | } |
83 | 100 |
|
84 | 101 | try { |
85 | | - await using d23 = { async [Symbol.asyncDispose]() {} }; |
| 102 | + await using d25 = { async [Symbol.asyncDispose]() {} }; |
86 | 103 | ~~~~~ |
87 | 104 | !!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. |
88 | 105 | } |
89 | 106 | catch { |
90 | | - await using d24 = { async [Symbol.asyncDispose]() {} }; |
| 107 | + await using d26 = { async [Symbol.asyncDispose]() {} }; |
91 | 108 | ~~~~~ |
92 | 109 | !!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. |
93 | 110 | } |
94 | 111 | finally { |
95 | | - await using d25 = { async [Symbol.asyncDispose]() {} }; |
| 112 | + await using d27 = { async [Symbol.asyncDispose]() {} }; |
96 | 113 | ~~~~~ |
97 | 114 | !!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. |
98 | 115 | } |
99 | 116 |
|
100 | 117 | if (true) { |
101 | | - await using d26 = { async [Symbol.asyncDispose]() {} }; |
| 118 | + await using d28 = { async [Symbol.asyncDispose]() {} }; |
102 | 119 | ~~~~~ |
103 | 120 | !!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. |
104 | 121 | } |
105 | 122 | else { |
106 | | - await using d27 = { async [Symbol.asyncDispose]() {} }; |
| 123 | + await using d29 = { async [Symbol.asyncDispose]() {} }; |
107 | 124 | ~~~~~ |
108 | 125 | !!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. |
109 | 126 | } |
110 | 127 |
|
111 | 128 | while (true) { |
112 | | - await using d28 = { async [Symbol.asyncDispose]() {} }; |
| 129 | + await using d30 = { async [Symbol.asyncDispose]() {} }; |
113 | 130 | ~~~~~ |
114 | 131 | !!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. |
115 | 132 | break; |
116 | 133 | } |
117 | 134 |
|
118 | 135 | do { |
119 | | - await using d29 = { async [Symbol.asyncDispose]() {} }; |
| 136 | + await using d31 = { async [Symbol.asyncDispose]() {} }; |
120 | 137 | ~~~~~ |
121 | 138 | !!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. |
122 | 139 | break; |
123 | 140 | } |
124 | 141 | while (true); |
125 | 142 |
|
126 | 143 | for (;;) { |
127 | | - await using d30 = { async [Symbol.asyncDispose]() {} }; |
| 144 | + await using d32 = { async [Symbol.asyncDispose]() {} }; |
128 | 145 | ~~~~~ |
129 | 146 | !!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. |
130 | 147 | break; |
131 | 148 | } |
132 | 149 |
|
133 | 150 | for (const x in {}) { |
134 | | - await using d31 = { async [Symbol.asyncDispose]() {} }; |
| 151 | + await using d33 = { async [Symbol.asyncDispose]() {} }; |
135 | 152 | ~~~~~ |
136 | 153 | !!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. |
137 | 154 | } |
138 | 155 |
|
139 | 156 | for (const x of []) { |
140 | | - await using d32 = { async [Symbol.asyncDispose]() {} }; |
| 157 | + await using d34 = { async [Symbol.asyncDispose]() {} }; |
141 | 158 | ~~~~~ |
142 | 159 | !!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. |
143 | 160 | } |
|
0 commit comments