|
1 |
| -awaitUsingDeclarations.16.ts(2,5): error TS2852: 'await using' statements are only allowed within async functions and at the top levels of modules. |
2 |
| -awaitUsingDeclarations.16.ts(3,5): error TS2852: 'await using' statements are only allowed within async functions and at the top levels of modules. |
3 |
| -awaitUsingDeclarations.16.ts(6,5): error TS2852: 'await using' statements are only allowed within async functions and at the top levels of modules. |
4 |
| -awaitUsingDeclarations.16.ts(7,5): error TS2852: 'await using' statements are only allowed within async functions and at the top levels of modules. |
| 1 | +awaitUsingDeclarations.16.ts(2,5): error TS1546: 'await using' declarations are not allowed in ambient contexts. |
| 2 | +awaitUsingDeclarations.16.ts(3,5): error TS1546: 'await using' declarations are not allowed in ambient contexts. |
| 3 | +awaitUsingDeclarations.16.ts(6,5): error TS1546: 'await using' declarations are not allowed in ambient contexts. |
| 4 | +awaitUsingDeclarations.16.ts(7,5): error TS1546: 'await using' declarations are not allowed in ambient contexts. |
5 | 5 |
|
6 | 6 |
|
7 | 7 | ==== awaitUsingDeclarations.16.ts (4 errors) ====
|
8 | 8 | declare namespace N {
|
9 | 9 | await using x: { [Symbol.asyncDispose](): Promise<void> };
|
10 |
| - ~~~~~ |
11 |
| -!!! error TS2852: 'await using' statements are only allowed within async functions and at the top levels of modules. |
| 10 | + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 11 | +!!! error TS1546: 'await using' declarations are not allowed in ambient contexts. |
12 | 12 | await using y: null;
|
13 |
| - ~~~~~ |
14 |
| -!!! error TS2852: 'await using' statements are only allowed within async functions and at the top levels of modules. |
| 13 | + ~~~~~~~~~~~~~~~~~~~ |
| 14 | +!!! error TS1546: 'await using' declarations are not allowed in ambient contexts. |
15 | 15 | }
|
16 | 16 | declare module 'M' {
|
17 | 17 | await using x: { [Symbol.asyncDispose](): Promise<void> };
|
18 |
| - ~~~~~ |
19 |
| -!!! error TS2852: 'await using' statements are only allowed within async functions and at the top levels of modules. |
| 18 | + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 19 | +!!! error TS1546: 'await using' declarations are not allowed in ambient contexts. |
20 | 20 | await using y: null;
|
21 |
| - ~~~~~ |
22 |
| -!!! error TS2852: 'await using' statements are only allowed within async functions and at the top levels of modules. |
| 21 | + ~~~~~~~~~~~~~~~~~~~ |
| 22 | +!!! error TS1546: 'await using' declarations are not allowed in ambient contexts. |
23 | 23 | }
|
24 | 24 |
|
0 commit comments