File: moduleDuplicateIdentifiers.errors.txt

package info (click to toggle)
node-typescript 3.3.3333-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 324,548 kB
  • sloc: makefile: 6; sh: 3
file content (55 lines) | stat: -rw-r--r-- 1,563 bytes parent folder | download | duplicates (7)
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
44
45
46
47
48
49
50
51
52
53
54
55
tests/cases/compiler/moduleDuplicateIdentifiers.ts(1,12): error TS2323: Cannot redeclare exported variable 'Foo'.
tests/cases/compiler/moduleDuplicateIdentifiers.ts(2,12): error TS2323: Cannot redeclare exported variable 'Foo'.
tests/cases/compiler/moduleDuplicateIdentifiers.ts(20,14): error TS2300: Duplicate identifier 'Kettle'.
tests/cases/compiler/moduleDuplicateIdentifiers.ts(24,14): error TS2300: Duplicate identifier 'Kettle'.


==== tests/cases/compiler/moduleDuplicateIdentifiers.ts (4 errors) ====
    export var Foo = 2;
               ~~~
!!! error TS2323: Cannot redeclare exported variable 'Foo'.
    export var Foo = 42; // Should error
               ~~~
!!! error TS2323: Cannot redeclare exported variable 'Foo'.
    
    export interface Bar {
    	_brand1: any;
    }
    
    export interface Bar { // Shouldn't error
    	_brand2: any;
    }
    
    export namespace FooBar {
    	export var member1 = 2;
    }
    
    export namespace FooBar { // Shouldn't error
    	export var member2 = 42;
    }
    
    export class Kettle {
                 ~~~~~~
!!! error TS2300: Duplicate identifier 'Kettle'.
    	member1 = 2;
    }
    
    export class Kettle { // Should error
                 ~~~~~~
!!! error TS2300: Duplicate identifier 'Kettle'.
    	member2 = 42;
    }
    
    export var Pot = 2;
    Pot = 42; // Shouldn't error
    
    export enum Utensils {
    	Spoon,
    	Fork,
    	Knife
    }
    
    export enum Utensils { // Shouldn't error
    	Spork = 3
    }