File: switchStatementsWithMultipleDefaults1.errors.txt

package info (click to toggle)
node-typescript 2.1.5-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 203,952 kB
  • ctags: 52,987
  • sloc: sh: 11; makefile: 5
file content (18 lines) | stat: -rw-r--r-- 690 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
tests/cases/compiler/switchStatementsWithMultipleDefaults1.ts(8,9): error TS1113: A 'default' clause cannot appear more than once in a 'switch' statement.


==== tests/cases/compiler/switchStatementsWithMultipleDefaults1.ts (1 errors) ====
        var x = 10;
        
        switch (x) {
            case 1:
            case 2:
            default:    // No issues.
                break;
            default:    // Error; second 'default' clause.
            ~~~~~~~~
!!! error TS1113: A 'default' clause cannot appear more than once in a 'switch' statement.
            default:    // Error; third 'default' clause.
            case 3:
                x *= x;
        }