File: isolatedModulesGlobalNamespacesAndEnums.errors.txt

package info (click to toggle)
node-typescript 5.0.4%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 459,140 kB
  • sloc: javascript: 1,972,754; makefile: 6; sh: 1
file content (43 lines) | stat: -rw-r--r-- 1,946 bytes parent folder | download
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
tests/cases/compiler/enum2.ts(3,9): error TS1281: Cannot access 'A' from another file without qualification when 'isolatedModules' is enabled. Use 'Enum.A' instead.
tests/cases/compiler/enum2.ts(4,9): error TS1281: Cannot access 'X' from another file without qualification when 'isolatedModules' is enabled. Use 'Enum.X' instead.
tests/cases/compiler/script-namespaces.ts(1,11): error TS1280: Namespaces are not allowed in global script files when 'isolatedModules' is enabled. If this file is not intended to be a global script, set 'moduleDetection' to 'force' or add an empty 'export {}' statement.


==== tests/cases/compiler/script-namespaces.ts (1 errors) ====
    namespace Instantiated {
              ~~~~~~~~~~~~
!!! error TS1280: Namespaces are not allowed in global script files when 'isolatedModules' is enabled. If this file is not intended to be a global script, set 'moduleDetection' to 'force' or add an empty 'export {}' statement.
        export const x = 1;
    }
    namespace Uninstantiated {
        export type T = number;
    }
    declare namespace Ambient {
        export const x: number;
    }
    
==== tests/cases/compiler/module-namespaces.ts (0 errors) ====
    export namespace Instantiated {
        export const x = 1;
    }
    
==== tests/cases/compiler/enum1.ts (0 errors) ====
    enum Enum { A, B, C }
    declare enum Enum { X = 1_000_000 }
    const d = 'd';
    
==== tests/cases/compiler/enum2.ts (2 errors) ====
    enum Enum {
        D = d,
        E = A, // error
            ~
!!! error TS1281: Cannot access 'A' from another file without qualification when 'isolatedModules' is enabled. Use 'Enum.A' instead.
        Y = X, // error
            ~
!!! error TS1281: Cannot access 'X' from another file without qualification when 'isolatedModules' is enabled. Use 'Enum.X' instead.
        Z = Enum.A
    }
    
    declare enum Enum {
        F = A
    }