2014-07-13 01:04:16 +02:00
|
|
|
class Foo { }
|
|
|
|
|
|
|
|
switch (0) {
|
|
|
|
case Foo: break; // Error
|
|
|
|
case "sss": break; // Error
|
2016-11-01 18:07:30 +01:00
|
|
|
case 123: break; // Error
|
2014-07-13 01:04:16 +02:00
|
|
|
case true: break; // Error
|
|
|
|
}
|
|
|
|
|
|
|
|
var s: any = 0;
|
|
|
|
|
|
|
|
// No error for all
|
|
|
|
switch (s) {
|
|
|
|
case Foo: break;
|
|
|
|
case "sss": break;
|
|
|
|
case 123: break;
|
|
|
|
case true: break;
|
2016-11-01 18:07:30 +01:00
|
|
|
}
|