File: awaitUsingDeclarations.13.errors.txt

package info (click to toggle)
node-typescript 5.2.2-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 497,488 kB
  • sloc: javascript: 2,107,274; makefile: 6; sh: 1
file content (15 lines) | stat: -rw-r--r-- 1,014 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
awaitUsingDeclarations.13.ts(1,1): error TS2853: 'await using' statements are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module.
awaitUsingDeclarations.13.ts(4,5): error TS2852: 'await using' statements are only allowed within async functions and at the top levels of modules.


==== awaitUsingDeclarations.13.ts (2 errors) ====
    await using x = null;
    ~~~~~
!!! error TS2853: 'await using' statements are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module.
    
    function f() {
        await using x = null;
        ~~~~~
!!! error TS2852: 'await using' statements are only allowed within async functions and at the top levels of modules.
!!! related TS1356 awaitUsingDeclarations.13.ts:3:10: Did you mean to mark this function as 'async'?
    }