| Index: tests/compiler/dart2js/resolver_test.dart
|
| diff --git a/tests/compiler/dart2js/resolver_test.dart b/tests/compiler/dart2js/resolver_test.dart
|
| index 5673e4a02a01cc010beac60786f3282fa793d0a5..5d448c8d92e670a8dc4e2d843b379db40f7611bf 100644
|
| --- a/tests/compiler/dart2js/resolver_test.dart
|
| +++ b/tests/compiler/dart2js/resolver_test.dart
|
| @@ -72,6 +72,7 @@ main() {
|
| testInitializers();
|
| testThis();
|
| testSuperCalls();
|
| + testSwitch();
|
| testTypeVariables();
|
| testToString();
|
| testIndexedOperator();
|
| @@ -203,6 +204,25 @@ testSuperCalls() {
|
| Expect.equals(fooA, called);
|
| }
|
|
|
| +testSwitch() {
|
| + MockCompiler compiler = new MockCompiler();
|
| + compiler.parseScript("class Foo { foo() {"
|
| + "switch (null) { case '': break; case 2: break; } } }");
|
| + compiler.resolveStatement("Foo foo;");
|
| + ClassElement fooElement = compiler.mainApp.find("Foo");
|
| + FunctionElement funElement = fooElement.lookupLocalMember("foo");
|
| + compiler.processQueue(compiler.enqueuer.resolution, funElement);
|
| + Expect.equals(0, compiler.warnings.length);
|
| + Expect.equals(1, compiler.errors.length);
|
| + Expect.equals(MessageKind.SWITCH_CASE_TYPES_NOT_EQUAL,
|
| + compiler.errors[0].message.kind);
|
| + Expect.equals(2, compiler.infos.length);
|
| + Expect.equals(MessageKind.SWITCH_CASE_TYPES_NOT_EQUAL_CASE,
|
| + compiler.infos[0].message.kind);
|
| + Expect.equals(MessageKind.SWITCH_CASE_TYPES_NOT_EQUAL_CASE,
|
| + compiler.infos[1].message.kind);
|
| +}
|
| +
|
| testThis() {
|
| MockCompiler compiler = new MockCompiler();
|
| compiler.parseScript("class Foo { foo() { return this; } }");
|
|
|