File: switchCaseCircularRefeference.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 (16 lines) | stat: -rw-r--r-- 667 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
tests/cases/compiler/switchCaseCircularRefeference.ts(5,10): error TS2678: Type '{ a: "A"; b: any; } | { a: "C"; e: any; }' is not comparable to type 'string'.
  Type '{ a: "C"; e: any; }' is not comparable to type 'string'.


==== tests/cases/compiler/switchCaseCircularRefeference.ts (1 errors) ====
    // Repro from #9507
    
    function f(x: {a: "A", b} | {a: "C", e}) {
        switch (x.a) {
        case x:
             ~
!!! error TS2678: Type '{ a: "A"; b: any; } | { a: "C"; e: any; }' is not comparable to type 'string'.
!!! error TS2678:   Type '{ a: "C"; e: any; }' is not comparable to type 'string'.
            break;
        }
    }