File: enums.errors.txt

package info (click to toggle)
node-typescript 5.0.4%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 459,116 kB
  • sloc: javascript: 1,972,754; makefile: 6; sh: 1
file content (40 lines) | stat: -rw-r--r-- 1,318 bytes parent folder | download | duplicates (4)
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
/b.ts(3,1): error TS1361: 'SyntaxKind' cannot be used as a value because it was imported using 'import type'.
/b.ts(4,1): error TS1361: 'SymbolFlags' cannot be used as a value because it was imported using 'import type'.


==== /a.ts (0 errors) ====
    enum SyntaxKind {
      ImportClause,
      ExportDeclaration
    }
    
    const enum SymbolFlags {
      Type = "Type",
      Value = "Value"
    }
    
    export type { SyntaxKind };
    export { SymbolFlags };
    
==== /b.ts (2 errors) ====
    import type { SyntaxKind, SymbolFlags } from './a';
    
    SyntaxKind.ImportClause;
    ~~~~~~~~~~
!!! error TS1361: 'SyntaxKind' cannot be used as a value because it was imported using 'import type'.
!!! related TS1376 /b.ts:1:15: 'SyntaxKind' was imported here.
    SymbolFlags.Type;
    ~~~~~~~~~~~
!!! error TS1361: 'SymbolFlags' cannot be used as a value because it was imported using 'import type'.
!!! related TS1376 /b.ts:1:27: 'SymbolFlags' was imported here.
    let kind: SyntaxKind.ImportClause;
    let flags: SymbolFlags;
    
    type TypeFlag = SymbolFlags.Type;
    export type { TypeFlag };
    
==== /c.ts (0 errors) ====
    import { SymbolFlags } from './a';
    import type { TypeFlag } from './b';
    const flags: TypeFlag = SymbolFlags.Type;