1
1
tests/cases/compiler/switchCasesExpressionTypeMismatch.ts(4,10): error TS2678: Type 'typeof Foo' is not comparable to type 'number'.
2
- tests/cases/compiler/switchCasesExpressionTypeMismatch.ts(5,10): error TS2678: Type 'string' is not comparable to type 'number'.
3
- tests/cases/compiler/switchCasesExpressionTypeMismatch.ts(7,10): error TS2678: Type 'boolean' is not comparable to type 'number'.
2
+ tests/cases/compiler/switchCasesExpressionTypeMismatch.ts(5,10): error TS2678: Type '"sss"' is not comparable to type '0'.
3
+ tests/cases/compiler/switchCasesExpressionTypeMismatch.ts(6,10): error TS2678: Type '123' is not comparable to type '0'.
4
+ tests/cases/compiler/switchCasesExpressionTypeMismatch.ts(7,10): error TS2678: Type 'true' is not comparable to type '0'.
4
5
5
6
6
- ==== tests/cases/compiler/switchCasesExpressionTypeMismatch.ts (3 errors) ====
7
+ ==== tests/cases/compiler/switchCasesExpressionTypeMismatch.ts (4 errors) ====
7
8
class Foo { }
8
9
9
10
switch (0) {
@@ -12,11 +13,13 @@ tests/cases/compiler/switchCasesExpressionTypeMismatch.ts(7,10): error TS2678: T
12
13
!!! error TS2678: Type 'typeof Foo' is not comparable to type 'number'.
13
14
case "sss": break; // Error
14
15
~~~~~
15
- !!! error TS2678: Type 'string' is not comparable to type 'number'.
16
- case 123: break; // No Error
16
+ !!! error TS2678: Type '"sss"' is not comparable to type '0'.
17
+ case 123: break; // Error
18
+ ~~~
19
+ !!! error TS2678: Type '123' is not comparable to type '0'.
17
20
case true: break; // Error
18
21
~~~~
19
- !!! error TS2678: Type 'boolean ' is not comparable to type 'number '.
22
+ !!! error TS2678: Type 'true ' is not comparable to type '0 '.
20
23
}
21
24
22
25
var s: any = 0;
@@ -27,4 +30,5 @@ tests/cases/compiler/switchCasesExpressionTypeMismatch.ts(7,10): error TS2678: T
27
30
case "sss": break;
28
31
case 123: break;
29
32
case true: break;
30
- }
33
+ }
34
+
0 commit comments