Index: tests/compiler/dart2js/type_checker_test.dart |
diff --git a/tests/compiler/dart2js/type_checker_test.dart b/tests/compiler/dart2js/type_checker_test.dart |
index 6b813b0616bbb844aa276284452147ab5e7a04c7..0dcfd071aa008d701c2ee3425e65391f30157a90 100644 |
--- a/tests/compiler/dart2js/type_checker_test.dart |
+++ b/tests/compiler/dart2js/type_checker_test.dart |
@@ -31,6 +31,7 @@ main() { |
testReturn, |
testFor, |
testWhile, |
+ testTry, |
testOperators, |
testConstructorInvocationArgumentCount, |
testConstructorInvocationArgumentTypes, |
@@ -107,6 +108,21 @@ testWhile() { |
analyze("do { int i = 0.5; } while (null);", MessageKind.NOT_ASSIGNABLE); |
} |
+testTry() { |
+ analyze("try {} finally {}"); |
+ analyze("try {} catch (e) { int i = e;} finally {}"); |
+ analyze("try {} catch (e, s) { int i = e; StackTrace j = s; } finally {}"); |
+ analyze("try {} on String catch (e) {} finally {}"); |
+ analyze("try { int i = ''; } finally {}", MessageKind.NOT_ASSIGNABLE); |
+ analyze("try {} finally { int i = ''; }", MessageKind.NOT_ASSIGNABLE); |
+ analyze("try {} on String catch (e) { int i = e; } finally {}", |
+ MessageKind.NOT_ASSIGNABLE); |
+ analyze("try {} catch (e, s) { int i = e; int j = s; } finally {}", |
+ MessageKind.NOT_ASSIGNABLE); |
+ analyze("try {} on String catch (e, s) { int i = e; int j = s; } finally {}", |
+ [MessageKind.NOT_ASSIGNABLE, MessageKind.NOT_ASSIGNABLE]); |
+} |
+ |
testOperators() { |
// TODO(karlklose): add the DartC tests for operators when we can parse |
// classes with operators. |