Index: lib/compiler/implementation/lib/mock.dart |
diff --git a/lib/compiler/implementation/lib/mock.dart b/lib/compiler/implementation/lib/mock.dart |
index 89e26be7fe34929bedd1de454fa3c135ea42d88c..d5e601c6756d9f6fa88b4a63743e29dcbbf5f3ba 100644 |
--- a/lib/compiler/implementation/lib/mock.dart |
+++ b/lib/compiler/implementation/lib/mock.dart |
@@ -13,6 +13,21 @@ class TypeError extends AssertionError { |
String toString() => msg; |
} |
+/** Thrown by the 'as' operator if the cast isn't valid. */ |
+class CastException implements TypeError { |
+ // TODO(lrn): Change actualType and expectedType to "Type" when reified |
+ // types are available. |
+ final Object actualType; |
+ final Object expectedType; |
+ |
+ CastException(this.actualType, this.expectedType); |
+ |
+ String toString() { |
+ return "CastException: Casting value of type $actualType to" |
+ " incompatible type $expectedType"; |
+ } |
+} |
+ |
class FallThroughError { |
const FallThroughError(); |
String toString() => "Switch case fall-through."; |