Closed
Description
The analyzer differes in behaviour from dart2js/VM. It's a compile-time error for dart2js/VM.
$ cat test.dart
main() {
switch(#abc) {
case #abc:
print('abc');
break;
case #xyz:
print('xyz');
break;
}
}
$ dartanalyzer test.dart
Analyzing [test.dart]...
No issues found
$ dart2js test.dart
test.dart:3:10:
Error: 'case' expression type 'Symbol' overrides 'operator =='.
case #abc:
^^^^
Error: Compilation failed.
$ dart test.dart
'file:///usr/local/google/home/kustermann/repositories/gcloud/test.dart': error: line 3 pos 11: type class of case expression must not implement operator ==
case #abc:
^
Slightly related to Issue #15445.