File: duplicateIdentifierInCatchBlock.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 (41 lines) | stat: -rw-r--r-- 1,761 bytes parent folder | download | duplicates (3)
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
tests/cases/compiler/duplicateIdentifierInCatchBlock.ts(1,5): error TS2300: Duplicate identifier 'v'.
tests/cases/compiler/duplicateIdentifierInCatchBlock.ts(3,14): error TS2300: Duplicate identifier 'v'.
tests/cases/compiler/duplicateIdentifierInCatchBlock.ts(6,10): error TS2300: Duplicate identifier 'w'.
tests/cases/compiler/duplicateIdentifierInCatchBlock.ts(8,9): error TS2300: Duplicate identifier 'w'.
tests/cases/compiler/duplicateIdentifierInCatchBlock.ts(12,9): error TS2300: Duplicate identifier 'x'.
tests/cases/compiler/duplicateIdentifierInCatchBlock.ts(13,14): error TS2300: Duplicate identifier 'x'.
tests/cases/compiler/duplicateIdentifierInCatchBlock.ts(16,9): error TS2403: Subsequent variable declarations must have the same type.  Variable 'p' must be of type 'string', but here has type 'number'.


==== tests/cases/compiler/duplicateIdentifierInCatchBlock.ts (7 errors) ====
    var v;
        ~
!!! error TS2300: Duplicate identifier 'v'.
    try { } catch (e) {
        function v() { }
                 ~
!!! error TS2300: Duplicate identifier 'v'.
    }
    
    function w() { }
             ~
!!! error TS2300: Duplicate identifier 'w'.
    try { } catch (e) {
        var w;
            ~
!!! error TS2300: Duplicate identifier 'w'.
    }
    
    try { } catch (e) {
        var x;
            ~
!!! error TS2300: Duplicate identifier 'x'.
        function x() { } // error
                 ~
!!! error TS2300: Duplicate identifier 'x'.
        function e() { } // error
        var p: string;
        var p: number; // error
            ~
!!! error TS2403: Subsequent variable declarations must have the same type.  Variable 'p' must be of type 'string', but here has type 'number'.
    }