Chromium Code Reviews| Index: sdk/lib/_internal/compiler/implementation/typechecker.dart |
| diff --git a/sdk/lib/_internal/compiler/implementation/typechecker.dart b/sdk/lib/_internal/compiler/implementation/typechecker.dart |
| index 965d95ff54392f7a13e8396fcf5e667a9da9d4e8..f5eccfd324f77b4134c447d7e01c2ae517c96231 100644 |
| --- a/sdk/lib/_internal/compiler/implementation/typechecker.dart |
| +++ b/sdk/lib/_internal/compiler/implementation/typechecker.dart |
| @@ -1508,6 +1508,7 @@ class TypeCheckerVisitor extends Visitor<DartType> { |
| ClassElement cls = type.element; |
| if (cls == compiler.doubleClass) return true; |
| if (cls == compiler.intClass || cls == compiler.stringClass) return false; |
| + if (cls == compiler.typeClass) return true; |
|
Johnni Winther
2013/11/26 14:53:48
Add a TODO that we in general need to look at the
|
| Element equals = cls.lookupMember('=='); |
| return equals.getEnclosingClass() != compiler.objectClass; |
| } |
| @@ -1562,7 +1563,8 @@ class TypeCheckerVisitor extends Visitor<DartType> { |
| if (firstCaseType != null && |
| invalidSwitchExpressionType(firstCase, firstCaseType)) { |
| compiler.reportError(firstCase.expression, |
| - MessageKind.SWITCH_CASE_VALUE_OVERRIDES_EQUALS); |
| + MessageKind.SWITCH_CASE_VALUE_OVERRIDES_EQUALS, |
| + {'type': firstCaseType}); |
| } |
| return StatementType.NOT_RETURNING; |
| } |