Fixes #527. Make type error detection less specific
diff --git a/Utils/dynamic_check.dart b/Utils/dynamic_check.dart
index ef5cb50..95e29eb 100644
--- a/Utils/dynamic_check.dart
+++ b/Utils/dynamic_check.dart
@@ -2,7 +2,8 @@
 import "expect.dart";
 
 checkTypeError(f()) {
-  Expect.throws(f, (e) => e is TypeError, "Type error should be thrown");
+  Expect.throws(f, (e) => e is TypeError || e is CastError,
+      "Type error should be thrown");
 }
 
 checkAssertionError(f(), [message]) {