From e92c759e0b43789a363be72e0f09bebcbbccc3ce Mon Sep 17 00:00:00 2001 From: Florian Loitsch Date: Wed, 11 Oct 2017 08:59:49 +0000 Subject: [PATCH] Migrate test block 129. Change-Id: I36f6a3f007862a7c5d2e8f304cb6730cdc9b4610 Reviewed-on: https://dart-review.googlesource.com/12289 Commit-Queue: Florian Loitsch Reviewed-by: Jakob Roland Andersen --- tests/language_2/language_2_analyzer.status | 57 ++++++ tests/language_2/language_2_dart2js.status | 58 +++++++ tests/language_2/language_2_flutter.status | 9 + tests/language_2/language_2_kernel.status | 62 +++++++ .../language_2/language_2_precompiled.status | 55 ++++++ tests/language_2/language_2_vm.status | 55 ++++++ .../language_2/malbounded_type_cast_test.dart | 24 +++ .../malbounded_type_literal_test.dart | 4 +- .../malbounded_type_test2_test.dart | 20 +-- .../language_2/malbounded_type_test_test.dart | 26 +++ tests/language_2/malformed2_lib.dart | 53 ++++++ tests/language_2/malformed2_test.dart | 57 ++++++ .../malformed_bound_test.dart | 15 +- .../malformed_inheritance_test.dart | 83 +++++++++ tests/language_2/malformed_test.dart | 81 +++++++++ .../malformed_type_test.dart | 4 +- .../many_calls_test.dart | 0 .../many_method_calls_test.dart | 0 tests/language_strong/language_strong.status | 9 - .../malbounded_type_cast_test.dart | 32 ---- .../malbounded_type_test_test.dart | 19 -- tests/language_strong/malformed2_lib.dart | 46 ----- tests/language_strong/malformed2_test.dart | 59 ------- .../malformed_inheritance_test.dart | 32 ---- tests/language_strong/malformed_test.dart | 163 ------------------ 25 files changed, 634 insertions(+), 389 deletions(-) create mode 100644 tests/language_2/malbounded_type_cast_test.dart rename tests/{language_strong => language_2}/malbounded_type_literal_test.dart (82%) rename tests/{language_strong => language_2}/malbounded_type_test2_test.dart (55%) create mode 100644 tests/language_2/malbounded_type_test_test.dart create mode 100644 tests/language_2/malformed2_lib.dart create mode 100644 tests/language_2/malformed2_test.dart rename tests/{language_strong => language_2}/malformed_bound_test.dart (52%) create mode 100644 tests/language_2/malformed_inheritance_test.dart create mode 100644 tests/language_2/malformed_test.dart rename tests/{language_strong => language_2}/malformed_type_test.dart (69%) rename tests/{language_strong => language_2}/many_calls_test.dart (100%) rename tests/{language_strong => language_2}/many_method_calls_test.dart (100%) delete mode 100644 tests/language_strong/malbounded_type_cast_test.dart delete mode 100644 tests/language_strong/malbounded_type_test_test.dart delete mode 100644 tests/language_strong/malformed2_lib.dart delete mode 100644 tests/language_strong/malformed2_test.dart delete mode 100644 tests/language_strong/malformed_inheritance_test.dart delete mode 100644 tests/language_strong/malformed_test.dart diff --git a/tests/language_2/language_2_analyzer.status b/tests/language_2/language_2_analyzer.status index b63502196e2..d29cb683411 100644 --- a/tests/language_2/language_2_analyzer.status +++ b/tests/language_2/language_2_analyzer.status @@ -161,6 +161,7 @@ if_null_precedence_test/07: MissingCompileTimeError is_not_class2_test/*: MissingCompileTimeError library_ambiguous_test/04: MissingCompileTimeError list_literal1_test/01: MissingCompileTimeError +malformed2_test/00: MissingCompileTimeError method_override2_test/00: MissingCompileTimeError method_override2_test/01: MissingCompileTimeError method_override2_test/02: MissingCompileTimeError @@ -892,6 +893,7 @@ generic_test: CompileTimeError generics_test: CompileTimeError import_core_prefix_test: CompileTimeError # "dynamic" should be defined in core. interceptor6_test: CompileTimeError +malformed2_test: Pass, MissingCompileTimeError # Issue 31056. mixin_super_2_test/01: MissingCompileTimeError mixin_super_2_test/03: MissingCompileTimeError mixin_supertype_subclass_test/02: MissingCompileTimeError @@ -1131,6 +1133,61 @@ library_ambiguous_test/01: MissingCompileTimeError library_ambiguous_test/02: MissingCompileTimeError library_ambiguous_test/03: MissingCompileTimeError library_ambiguous_test/04: MissingCompileTimeError +malbounded_type_cast_test/00: MissingCompileTimeError +malbounded_type_cast_test/01: MissingCompileTimeError +malbounded_type_cast_test/02: MissingCompileTimeError +malbounded_type_cast_test/none: Pass +malbounded_type_literal_test/00: MissingCompileTimeError +malbounded_type_literal_test/none: Pass +malbounded_type_test2_test/00: MissingCompileTimeError +malbounded_type_test2_test/none: Pass +malbounded_type_test_test/00: MissingCompileTimeError +malbounded_type_test_test/01: MissingCompileTimeError +malbounded_type_test_test/02: MissingCompileTimeError +malformed2_test/01: MissingCompileTimeError +malformed2_test/02: MissingCompileTimeError +malformed2_test/03: MissingCompileTimeError +malformed2_test/04: MissingCompileTimeError +malformed2_test/05: MissingCompileTimeError +malformed2_test/06: MissingCompileTimeError +malformed2_test/07: MissingCompileTimeError +malformed2_test/08: MissingCompileTimeError +malformed2_test/09: MissingCompileTimeError +malformed2_test/10: MissingCompileTimeError +malformed2_test/11: MissingCompileTimeError +malformed2_test/12: MissingCompileTimeError +malformed2_test/13: MissingCompileTimeError +malformed_bound_test/00: MissingCompileTimeError +malformed_bound_test/01: MissingCompileTimeError +malformed_inheritance_test/01: MissingCompileTimeError +malformed_inheritance_test/03: MissingCompileTimeError +malformed_inheritance_test/05: MissingCompileTimeError +malformed_test/00: MissingCompileTimeError +malformed_test/01: MissingCompileTimeError +malformed_test/02: MissingCompileTimeError +malformed_test/03: MissingCompileTimeError +malformed_test/04: MissingCompileTimeError +malformed_test/05: MissingCompileTimeError +malformed_test/06: MissingCompileTimeError +malformed_test/07: MissingCompileTimeError +malformed_test/08: MissingCompileTimeError +malformed_test/09: MissingCompileTimeError +malformed_test/10: MissingCompileTimeError +malformed_test/11: MissingCompileTimeError +malformed_test/12: MissingCompileTimeError +malformed_test/13: MissingCompileTimeError +malformed_test/14: MissingCompileTimeError +malformed_test/15: MissingCompileTimeError +malformed_test/16: MissingCompileTimeError +malformed_test/17: MissingCompileTimeError +malformed_test/18: MissingCompileTimeError +malformed_test/19: MissingCompileTimeError +malformed_test/20: MissingCompileTimeError +malformed_test/21: MissingCompileTimeError +malformed_test/22: MissingCompileTimeError +malformed_test/23: MissingCompileTimeError +malformed_test/24: MissingCompileTimeError +malformed_type_test: MissingCompileTimeError multiple_interface_inheritance_test: StaticWarning # Issue 30552 named_parameters_test/01: MissingCompileTimeError named_parameters_test/02: MissingCompileTimeError diff --git a/tests/language_2/language_2_dart2js.status b/tests/language_2/language_2_dart2js.status index 78970e9f249..24dded077b2 100644 --- a/tests/language_2/language_2_dart2js.status +++ b/tests/language_2/language_2_dart2js.status @@ -247,6 +247,60 @@ library_ambiguous_test/01: MissingCompileTimeError library_ambiguous_test/02: MissingCompileTimeError library_ambiguous_test/03: MissingCompileTimeError library_ambiguous_test/04: MissingCompileTimeError +malbounded_type_cast_test/00: MissingCompileTimeError +malbounded_type_cast_test/01: MissingCompileTimeError +malbounded_type_cast_test/02: MissingCompileTimeError +malbounded_type_cast_test/none: RuntimeError +malbounded_type_literal_test/00: MissingCompileTimeError +malbounded_type_test2_test/00: MissingCompileTimeError +malbounded_type_test_test/00: MissingCompileTimeError +malbounded_type_test_test/01: MissingCompileTimeError +malbounded_type_test_test/02: MissingCompileTimeError +malbounded_type_test_test/none: RuntimeError +malformed2_test/01: MissingCompileTimeError +malformed2_test/02: MissingCompileTimeError +malformed2_test/03: MissingCompileTimeError +malformed2_test/04: MissingCompileTimeError +malformed2_test/05: MissingCompileTimeError +malformed2_test/06: MissingCompileTimeError +malformed2_test/07: MissingCompileTimeError +malformed2_test/08: MissingCompileTimeError +malformed2_test/09: MissingCompileTimeError +malformed2_test/10: MissingCompileTimeError +malformed2_test/11: MissingCompileTimeError +malformed2_test/12: MissingCompileTimeError +malformed2_test/13: MissingCompileTimeError +malformed_bound_test/00: MissingCompileTimeError +malformed_bound_test/01: MissingCompileTimeError +malformed_inheritance_test/01: MissingCompileTimeError +malformed_inheritance_test/03: MissingCompileTimeError +malformed_inheritance_test/05: MissingCompileTimeError +malformed_test/00: MissingCompileTimeError +malformed_test/01: MissingCompileTimeError +malformed_test/02: MissingCompileTimeError +malformed_test/03: MissingCompileTimeError +malformed_test/04: MissingCompileTimeError +malformed_test/05: MissingCompileTimeError +malformed_test/06: MissingCompileTimeError +malformed_test/07: MissingCompileTimeError +malformed_test/08: MissingCompileTimeError +malformed_test/09: MissingCompileTimeError +malformed_test/10: MissingCompileTimeError +malformed_test/11: MissingCompileTimeError +malformed_test/12: MissingCompileTimeError +malformed_test/13: MissingCompileTimeError +malformed_test/14: MissingCompileTimeError +malformed_test/15: MissingCompileTimeError +malformed_test/16: MissingCompileTimeError +malformed_test/17: MissingCompileTimeError +malformed_test/18: MissingCompileTimeError +malformed_test/19: MissingCompileTimeError +malformed_test/20: MissingCompileTimeError +malformed_test/21: MissingCompileTimeError +malformed_test/22: MissingCompileTimeError +malformed_test/23: MissingCompileTimeError +malformed_test/24: MissingCompileTimeError +malformed_type_test: MissingCompileTimeError method_name_test: Pass method_override2_test/none: Pass method_override2_test/*: MissingCompileTimeError @@ -823,6 +877,7 @@ getters_setters2_test/01: RuntimeError getters_setters2_test/none: RuntimeError if_null_precedence_test/none: RuntimeError inferrer_synthesized_constructor_test: RuntimeError +malformed2_test/00: MissingCompileTimeError typevariable_substitution2_test/02: RuntimeError [ $compiler == dart2js && !$checked && !$enable_asserts && !$dart2js_with_kernel && $runtime != none ] @@ -1623,6 +1678,9 @@ async_return_types_test/wrongTypeParameter: Fail # Issue 26429 covariant_subtyping_test: CompileTimeError default_factory2_test/01: Fail # Issue 14121 regress_26133_test: RuntimeError # Issue 26429 +malbounded_type_cast_test: Fail # Issue 14121 +malbounded_type_test_test/03: Fail # Issue 14121 +malbounded_type_test_test/04: Fail # Issue 14121 [ $compiler == dart2js && !$checked && !$dart2js_with_kernel ] bool_check_test: RuntimeError # Issue 29647 diff --git a/tests/language_2/language_2_flutter.status b/tests/language_2/language_2_flutter.status index 3d38c15fb1b..660d0550097 100644 --- a/tests/language_2/language_2_flutter.status +++ b/tests/language_2/language_2_flutter.status @@ -278,6 +278,15 @@ no_such_method_test: CompileTimeError try_catch_on_syntax_test/07: CompileTimeError regress_28255_test: CompileTimeError regress_23408_test: CompileTimeError +malformed_test/none: CompileTimeError +malbounded_type_test_test/02: CompileTimeError +malformed_type_test: CompileTimeError +malformed_inheritance_test/02: CompileTimeError +malformed_inheritance_test/04: CompileTimeError +malformed_inheritance_test/06: CompileTimeError +malformed2_test/00: CompileTimeError +malbounded_type_literal_test: CompileTimeError +malbounded_type_cast_test: CompileTimeError private_access_test/03: CompileTimeError private_access_test/04: CompileTimeError list_literal_syntax_test/03: CompileTimeError diff --git a/tests/language_2/language_2_kernel.status b/tests/language_2/language_2_kernel.status index 79592a7151c..e337c4aa519 100644 --- a/tests/language_2/language_2_kernel.status +++ b/tests/language_2/language_2_kernel.status @@ -160,6 +160,62 @@ if_null_evaluation_order_test: Pass if_null_precedence_test/06: MissingCompileTimeError if_null_precedence_test/07: MissingCompileTimeError if_null_precedence_test/none: RuntimeError +malbounded_type_cast_test/00: MissingCompileTimeError +malbounded_type_cast_test/01: MissingCompileTimeError +malbounded_type_cast_test/02: MissingCompileTimeError +malbounded_type_cast_test/none: RuntimeError +malbounded_type_literal_test/00: MissingCompileTimeError +malbounded_type_test2_test/00: MissingCompileTimeError +malbounded_type_test_test/00: MissingCompileTimeError +malbounded_type_test_test/01: MissingCompileTimeError +malbounded_type_test_test/02: MissingCompileTimeError +malbounded_type_test_test/none: RuntimeError +malformed2_test/00: MissingCompileTimeError +malformed2_test/01: MissingCompileTimeError +malformed2_test/02: MissingCompileTimeError +malformed2_test/03: MissingCompileTimeError +malformed2_test/04: MissingCompileTimeError +malformed2_test/05: MissingCompileTimeError +malformed2_test/06: MissingCompileTimeError +malformed2_test/07: MissingCompileTimeError +malformed2_test/08: MissingCompileTimeError +malformed2_test/09: MissingCompileTimeError +malformed2_test/10: MissingCompileTimeError +malformed2_test/11: MissingCompileTimeError +malformed2_test/12: MissingCompileTimeError +malformed2_test/13: MissingCompileTimeError +malformed_bound_test/00: MissingCompileTimeError +malformed_bound_test/01: MissingCompileTimeError +malformed_inheritance_test/01: MissingCompileTimeError +malformed_inheritance_test/03: MissingCompileTimeError +malformed_inheritance_test/05: MissingCompileTimeError +malformed_test/00: MissingCompileTimeError +malformed_test/01: MissingCompileTimeError +malformed_test/02: MissingCompileTimeError +malformed_test/03: MissingCompileTimeError +malformed_test/04: MissingCompileTimeError +malformed_test/05: MissingCompileTimeError +malformed_test/06: MissingCompileTimeError +malformed_test/07: MissingCompileTimeError +malformed_test/08: MissingCompileTimeError +malformed_test/09: MissingCompileTimeError +malformed_test/10: MissingCompileTimeError +malformed_test/11: MissingCompileTimeError +malformed_test/12: MissingCompileTimeError +malformed_test/13: MissingCompileTimeError +malformed_test/14: MissingCompileTimeError +malformed_test/15: MissingCompileTimeError +malformed_test/16: MissingCompileTimeError +malformed_test/17: MissingCompileTimeError +malformed_test/18: MissingCompileTimeError +malformed_test/19: MissingCompileTimeError +malformed_test/20: MissingCompileTimeError +malformed_test/21: MissingCompileTimeError +malformed_test/22: MissingCompileTimeError +malformed_test/23: MissingCompileTimeError +malformed_test/24: MissingCompileTimeError +malformed_type_test: MissingCompileTimeError +malformed_test/17: MissingCompileTimeError initializing_formal_final_test: MissingCompileTimeError initializing_formal_type_test: MissingCompileTimeError issue_1751477_test: RuntimeError @@ -254,6 +310,11 @@ type_parameter_test/none: RuntimeError type_variable_bounds4_test/01: RuntimeError regress_22728_test: RuntimeError regress_26133_test: RuntimeError +malbounded_type_cast_test: RuntimeError +malbounded_type_test_test/03: Fail +malbounded_type_test_test/04: Fail +malformed2_test/00: RuntimeError +malformed2_test/01: MissingCompileTimeError factory_redirection_test/08: Fail factory_redirection_test/09: Fail factory_redirection_test/10: Fail @@ -521,5 +582,6 @@ async_star_test/01: Pass regress_22728_test: Fail # Dartk Issue 28498 [ $compiler == dartkp && $mode == debug ] +malbounded_type_cast_test: Crash external_test/13: Crash final_syntax_test/09: Crash diff --git a/tests/language_2/language_2_precompiled.status b/tests/language_2/language_2_precompiled.status index fbd46f3df2a..f3c78a875f6 100644 --- a/tests/language_2/language_2_precompiled.status +++ b/tests/language_2/language_2_precompiled.status @@ -266,6 +266,61 @@ library_ambiguous_test/04: MissingCompileTimeError many_generic_instanceof_test: RuntimeError many_overridden_no_such_method_test: SkipByDesign map_literal8_test: RuntimeError +malbounded_type_cast_test/00: MissingCompileTimeError +malbounded_type_cast_test/01: MissingCompileTimeError +malbounded_type_cast_test/02: MissingCompileTimeError +malbounded_type_cast_test/none: RuntimeError +malbounded_type_literal_test/00: MissingCompileTimeError +malbounded_type_test2_test/00: MissingCompileTimeError +malbounded_type_test_test/00: MissingCompileTimeError +malbounded_type_test_test/01: MissingCompileTimeError +malbounded_type_test_test/02: MissingCompileTimeError +malbounded_type_test_test/none: RuntimeError +malformed2_test/00: MissingCompileTimeError +malformed2_test/01: MissingCompileTimeError +malformed2_test/02: MissingCompileTimeError +malformed2_test/03: MissingCompileTimeError +malformed2_test/04: MissingCompileTimeError +malformed2_test/05: MissingCompileTimeError +malformed2_test/06: MissingCompileTimeError +malformed2_test/07: MissingCompileTimeError +malformed2_test/08: MissingCompileTimeError +malformed2_test/09: MissingCompileTimeError +malformed2_test/10: MissingCompileTimeError +malformed2_test/11: MissingCompileTimeError +malformed2_test/12: MissingCompileTimeError +malformed2_test/13: MissingCompileTimeError +malformed_bound_test/00: MissingCompileTimeError +malformed_bound_test/01: MissingCompileTimeError +malformed_inheritance_test/01: MissingCompileTimeError +malformed_inheritance_test/03: MissingCompileTimeError +malformed_inheritance_test/05: MissingCompileTimeError +malformed_test/00: MissingCompileTimeError +malformed_test/01: MissingCompileTimeError +malformed_test/02: MissingCompileTimeError +malformed_test/03: MissingCompileTimeError +malformed_test/04: MissingCompileTimeError +malformed_test/05: MissingCompileTimeError +malformed_test/06: MissingCompileTimeError +malformed_test/07: MissingCompileTimeError +malformed_test/08: MissingCompileTimeError +malformed_test/09: MissingCompileTimeError +malformed_test/10: MissingCompileTimeError +malformed_test/11: MissingCompileTimeError +malformed_test/12: MissingCompileTimeError +malformed_test/13: MissingCompileTimeError +malformed_test/14: MissingCompileTimeError +malformed_test/15: MissingCompileTimeError +malformed_test/16: MissingCompileTimeError +malformed_test/17: MissingCompileTimeError +malformed_test/18: MissingCompileTimeError +malformed_test/19: MissingCompileTimeError +malformed_test/20: MissingCompileTimeError +malformed_test/21: MissingCompileTimeError +malformed_test/22: MissingCompileTimeError +malformed_test/23: MissingCompileTimeError +malformed_test/24: MissingCompileTimeError +malformed_type_test: MissingCompileTimeError method_override2_test/*: MissingCompileTimeError method_override2_test/none: Pass method_override2_test/none: Pass diff --git a/tests/language_2/language_2_vm.status b/tests/language_2/language_2_vm.status index 494c0d5cf83..c381380df80 100644 --- a/tests/language_2/language_2_vm.status +++ b/tests/language_2/language_2_vm.status @@ -253,6 +253,60 @@ library_ambiguous_test/01: MissingCompileTimeError library_ambiguous_test/02: MissingCompileTimeError library_ambiguous_test/03: MissingCompileTimeError library_ambiguous_test/04: MissingCompileTimeError +malbounded_type_cast_test/00: MissingCompileTimeError +malbounded_type_cast_test/01: MissingCompileTimeError +malbounded_type_cast_test/02: MissingCompileTimeError +malbounded_type_cast_test/none: RuntimeError +malbounded_type_literal_test/00: MissingCompileTimeError +malbounded_type_test2_test/00: MissingCompileTimeError +malbounded_type_test_test/00: MissingCompileTimeError +malbounded_type_test_test/01: MissingCompileTimeError +malbounded_type_test_test/02: MissingCompileTimeError +malbounded_type_test_test/none: RuntimeError +malformed2_test/01: MissingCompileTimeError +malformed2_test/02: MissingCompileTimeError +malformed2_test/03: MissingCompileTimeError +malformed2_test/04: MissingCompileTimeError +malformed2_test/05: MissingCompileTimeError +malformed2_test/06: MissingCompileTimeError +malformed2_test/07: MissingCompileTimeError +malformed2_test/08: MissingCompileTimeError +malformed2_test/09: MissingCompileTimeError +malformed2_test/10: MissingCompileTimeError +malformed2_test/11: MissingCompileTimeError +malformed2_test/12: MissingCompileTimeError +malformed2_test/13: MissingCompileTimeError +malformed_bound_test/00: MissingCompileTimeError +malformed_bound_test/01: MissingCompileTimeError +malformed_inheritance_test/01: MissingCompileTimeError +malformed_inheritance_test/03: MissingCompileTimeError +malformed_inheritance_test/05: MissingCompileTimeError +malformed_test/00: MissingCompileTimeError +malformed_test/01: MissingCompileTimeError +malformed_test/02: MissingCompileTimeError +malformed_test/03: MissingCompileTimeError +malformed_test/04: MissingCompileTimeError +malformed_test/05: MissingCompileTimeError +malformed_test/06: MissingCompileTimeError +malformed_test/07: MissingCompileTimeError +malformed_test/08: MissingCompileTimeError +malformed_test/09: MissingCompileTimeError +malformed_test/10: MissingCompileTimeError +malformed_test/11: MissingCompileTimeError +malformed_test/12: MissingCompileTimeError +malformed_test/13: MissingCompileTimeError +malformed_test/14: MissingCompileTimeError +malformed_test/15: MissingCompileTimeError +malformed_test/16: MissingCompileTimeError +malformed_test/17: MissingCompileTimeError +malformed_test/18: MissingCompileTimeError +malformed_test/19: MissingCompileTimeError +malformed_test/20: MissingCompileTimeError +malformed_test/21: MissingCompileTimeError +malformed_test/22: MissingCompileTimeError +malformed_test/23: MissingCompileTimeError +malformed_test/24: MissingCompileTimeError +malformed_type_test: MissingCompileTimeError many_generic_instanceof_test: RuntimeError map_literal8_test: RuntimeError method_override2_test/00: MissingCompileTimeError @@ -830,6 +884,7 @@ getters_setters2_test/01: RuntimeError getters_setters2_test/none: RuntimeError if_null_precedence_test/none: RuntimeError inferrer_synthesized_constructor_test: RuntimeError +malformed2_test/00: MissingCompileTimeError type_check_const_function_typedef2_test: MissingCompileTimeError type_argument_in_super_type_test: RuntimeError typevariable_substitution2_test/02: RuntimeError diff --git a/tests/language_2/malbounded_type_cast_test.dart b/tests/language_2/malbounded_type_cast_test.dart new file mode 100644 index 00000000000..cdfd96097e7 --- /dev/null +++ b/tests/language_2/malbounded_type_cast_test.dart @@ -0,0 +1,24 @@ +// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:expect/expect.dart'; + +class Super {} +class Malbounded1 implements Super + //# 00: compile-time error + {} +class Malbounded2 extends Super + //# 01: compile-time error + {} + +main() { + var m = new Malbounded1(); + Expect.throws(() => m as Super, (e) => e is CastError); + var s = new Super(); + Expect.throws(() => s as Malbounded1, (e) => e is CastError); + Expect.throws(() => s as Malbounded2, (e) => e is CastError); + s as Super + //# 02: compile-time error + ; +} diff --git a/tests/language_strong/malbounded_type_literal_test.dart b/tests/language_2/malbounded_type_literal_test.dart similarity index 82% rename from tests/language_strong/malbounded_type_literal_test.dart rename to tests/language_2/malbounded_type_literal_test.dart index 08c19d58b59..4ab59077a19 100644 --- a/tests/language_strong/malbounded_type_literal_test.dart +++ b/tests/language_2/malbounded_type_literal_test.dart @@ -6,7 +6,9 @@ import 'package:expect/expect.dart'; class Super {} -class Malbounded extends Super {} +class Malbounded extends Super + //# 00: compile-time error + {} main() { Type t = Malbounded; diff --git a/tests/language_strong/malbounded_type_test2_test.dart b/tests/language_2/malbounded_type_test2_test.dart similarity index 55% rename from tests/language_strong/malbounded_type_test2_test.dart rename to tests/language_2/malbounded_type_test2_test.dart index 1dee6fd8cc8..80b313e1ea7 100644 --- a/tests/language_strong/malbounded_type_test2_test.dart +++ b/tests/language_2/malbounded_type_test2_test.dart @@ -4,29 +4,17 @@ import "package:expect/expect.dart"; -isCheckedMode() { - try { - var i = 1; - String s = i; - return false; - } catch (e) { - return true; - } -} - class A {} class B { test() { - new A() is A; // //# static type warning + new A() is A + //# 00: compile-time error + ; } } main() { var b = new B(); - if (isCheckedMode()) { - Expect.throws(() => b.test(), (e) => e is TypeError); - } else { - b.test(); - } + b.test(); } diff --git a/tests/language_2/malbounded_type_test_test.dart b/tests/language_2/malbounded_type_test_test.dart new file mode 100644 index 00000000000..405d2210308 --- /dev/null +++ b/tests/language_2/malbounded_type_test_test.dart @@ -0,0 +1,26 @@ +// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:expect/expect.dart'; + +class Super {} + +class Malbounded1 implements Super + //# 00: compile-time error + {} + +class Malbounded2 extends Super + //# 01: compile-time error + {} + +main() { + var m = new Malbounded1(); + Expect.isFalse(m is Super); + var s = new Super(); + Expect.isFalse(s is Malbounded1); + Expect.isFalse(s is Malbounded2); + Expect.isTrue(s is Super + //# 02: compile-time error + ); +} diff --git a/tests/language_2/malformed2_lib.dart b/tests/language_2/malformed2_lib.dart new file mode 100644 index 00000000000..a940c82dc92 --- /dev/null +++ b/tests/language_2/malformed2_lib.dart @@ -0,0 +1,53 @@ +// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +part of malformed_test; + +void testValue(var o) { + o is Unresolved1; + o is List; + o is! Unresolved3; + o is! List; + + try { + o as Unresolved5; + } catch (e) { + } + + try { + o as List; + } catch (e) { + } + + try { + } on Unresolved7 catch (e) { + } catch (e) { + } + + try { + throw o; + } on Unresolved8 catch (e) { + } catch (e) { + } + + try { + throw o; + } on List catch (e) { + } on NullThrownError catch (e) { + } on Unresolved9 catch (e) { + } catch (e) { + } + + try { + throw o; + } on List catch (e) { + } on NullThrownError catch (e) { + } on Unresolved11 catch (e) { + } catch (e) { + } + + Unresolved12 u = o; + + List u2 = o; +} diff --git a/tests/language_2/malformed2_test.dart b/tests/language_2/malformed2_test.dart new file mode 100644 index 00000000000..79061c2419a --- /dev/null +++ b/tests/language_2/malformed2_test.dart @@ -0,0 +1,57 @@ +// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +library malformed_test; + +// This part includes the actual tests. +part 'malformed2_lib.dart'; + +// The part-file cannot contain error markers. +// Therefore we create a fresh class for each test. +/* //# 01: compile-time error +class Unresolved1 {} +*/ //# 01: continued +/* //# 02: compile-time error +class Unresolved2 {} +*/ //# 02: continued +/* //# 03: compile-time error +class Unresolved3 {} +*/ //# 03: continued +/* //# 04: compile-time error +class Unresolved4 {} +*/ //# 04: continued +/* //# 05: compile-time error +class Unresolved5 {} +*/ //# 05: continued +/* //# 06: compile-time error +class Unresolved6 {} +*/ //# 06: continued +/* //# 07: compile-time error +class Unresolved7 {} +*/ //# 07: continued +/* //# 08: compile-time error +class Unresolved8 {} +*/ //# 08: continued +/* //# 09: compile-time error +class Unresolved9 {} +*/ //# 09: continued +/* //# 10: compile-time error +class Unresolved10 {} +*/ //# 10: continued +/* //# 11: compile-time error +class Unresolved11 {} +*/ //# 11: continued +/* //# 12: compile-time error +class Unresolved12 {} +*/ //# 12: continued +/* //# 13: compile-time error +class Unresolved13 {} +*/ //# 13: continued + +const Unresolved c1 = 0; //# 00: compile-time error + +void main() { + print(c1); //# 00: continued + testValue(null); +} diff --git a/tests/language_strong/malformed_bound_test.dart b/tests/language_2/malformed_bound_test.dart similarity index 52% rename from tests/language_strong/malformed_bound_test.dart rename to tests/language_2/malformed_bound_test.dart index 623077c909b..035cedf9fe7 100644 --- a/tests/language_strong/malformed_bound_test.dart +++ b/tests/language_2/malformed_bound_test.dart @@ -2,17 +2,14 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// Test that a malformed type variable bound is treated as dynamic. - -class C< - T - extends Malformed //# 01: static type warning, runtime error +class C { - f(T t) => t.foo; //# 01: continued + f(T t) => t + .foo //# 01: compile-time error + ; } main() { - new C() - .f(1) //# 01: continued - ; + new C().f(1); } diff --git a/tests/language_2/malformed_inheritance_test.dart b/tests/language_2/malformed_inheritance_test.dart new file mode 100644 index 00000000000..7baed22d824 --- /dev/null +++ b/tests/language_2/malformed_inheritance_test.dart @@ -0,0 +1,83 @@ +// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +// Tests that malformed types used in extends, implements, and with clauses +// cause compile-time errors. + +class A {} + +class C + extends Unresolved //# 00: compile-time error + { +} + +class C1 + extends A //# 01: compile-time error + { +} + +class C2 + extends Object with Unresolved //# 02: compile-time error + { +} + +class C3 + extends Object with A //# 03: compile-time error + { +} + +class C4 + implements Unresolved //# 04: compile-time error + { +} + +class C5 + implements A //# 05: compile-time error + { +} + +class C6 + extends A //# 06: compile-time error + { +} + +class C7 + extends A //# 07: compile-time error + { +} + +class C8 + extends Object with A //# 08: compile-time error + { +} + +class C9 + extends Object with A //# 09: compile-time error + { +} + +class C10 + implements A //# 10: compile-time error + { +} + +class C11 + implements A //# 11: compile-time error + { +} + +void main() { + new C(); + new C1(); + new C2(); + new C3(); + new C4(); + new C5(); + new C6(); + new C7(); + new C8(); + new C9(); + new C10(); + new C11(); +} diff --git a/tests/language_2/malformed_test.dart b/tests/language_2/malformed_test.dart new file mode 100644 index 00000000000..b032bc0b8a1 --- /dev/null +++ b/tests/language_2/malformed_test.dart @@ -0,0 +1,81 @@ +// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:expect/expect.dart'; +import 'package:expect/expect.dart' as prefix; // Define 'prefix'. + +checkIsUnresolved(var v) { + v is Unresolved; //# 00: compile-time error + v is Unresolved; //# 01: compile-time error + v is prefix.Unresolved; //# 02: compile-time error + v is prefix.Unresolved; //# 03: compile-time error +} + +checkIsListUnresolved(var v) { + v is List; //# 04: compile-time error + v is List>; //# 05: compile-time error + v is List; //# 06: compile-time error + v is List>; //# 07: compile-time error + v is List; //# 08: compile-time error +} + +checkAsUnresolved(var v) { + v as Unresolved; //# 09: compile-time error + v as Unresolved; //# 10: compile-time error + v as prefix.Unresolved; //# 11: compile-time error + v as prefix.Unresolved; //# 12: compile-time error +} + +checkAsListUnresolved(var v) { + v as List; //# 13: compile-time error + v as List>; //# 14: compile-time error + v as List; //# 15: compile-time error + v as List>; //# 16: compile-time error + v as List; //# 17: compile-time error +} + +void main() { + checkIsUnresolved(''); + checkAsUnresolved(''); + checkIsListUnresolved(new List()); + checkAsListUnresolved(new List()); + + new undeclared_prefix.Unresolved(); //# 18: compile-time error + new undeclared_prefix.Unresolved(); //# 19: compile-time error + + try { + throw 'foo'; + } + on Unresolved //# 20: compile-time error + catch (e) { + } + + try { + throw 'foo'; + } + on Unresolved //# 21: compile-time error + catch (e) { + } + + try { + throw 'foo'; + } + on prefix.Unresolved //# 22: compile-time error + catch (e) { + } + + try { + throw 'foo'; + } + on prefix.Unresolved //# 23: compile-time error + catch (e) { + } + + try { + throw 'foo'; + } + on undeclared_prefix.Unresolved // //# 24: compile-time error + catch (e) { + } +} diff --git a/tests/language_strong/malformed_type_test.dart b/tests/language_2/malformed_type_test.dart similarity index 69% rename from tests/language_strong/malformed_type_test.dart rename to tests/language_2/malformed_type_test.dart index 615d9eece67..b464d6eed97 100644 --- a/tests/language_strong/malformed_type_test.dart +++ b/tests/language_2/malformed_type_test.dart @@ -2,10 +2,8 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// Regression test for issue 11792. - null_() => null; -final Undeclared x = null_(); // null is assignable to x of malformed type. +final Undeclared/*@compile-error=unspecified*/ x = null_(); main() { print(x); diff --git a/tests/language_strong/many_calls_test.dart b/tests/language_2/many_calls_test.dart similarity index 100% rename from tests/language_strong/many_calls_test.dart rename to tests/language_2/many_calls_test.dart diff --git a/tests/language_strong/many_method_calls_test.dart b/tests/language_2/many_method_calls_test.dart similarity index 100% rename from tests/language_strong/many_method_calls_test.dart rename to tests/language_2/many_method_calls_test.dart diff --git a/tests/language_strong/language_strong.status b/tests/language_strong/language_strong.status index b104c834cde..9e9a127db04 100644 --- a/tests/language_strong/language_strong.status +++ b/tests/language_strong/language_strong.status @@ -153,15 +153,6 @@ malbounded_instantiation_test: Skip malbounded_redirecting_factory2_test: Skip malbounded_redirecting_factory_test: Skip malbounded_type_cast2_test: Skip -malbounded_type_cast_test: Skip -malbounded_type_literal_test: Skip -malbounded_type_test2_test: Skip -malbounded_type_test_test: Skip -malformed2_test: Skip -malformed_bound_test: Skip -malformed_inheritance_test: Skip -malformed_test: Skip -malformed_type_test: Skip missing_const_constructor_test: Skip missing_part_of_tag_test: Skip mixin_black_listed_test: Skip diff --git a/tests/language_strong/malbounded_type_cast_test.dart b/tests/language_strong/malbounded_type_cast_test.dart deleted file mode 100644 index 1a6ebb99c97..00000000000 --- a/tests/language_strong/malbounded_type_cast_test.dart +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -import 'package:expect/expect.dart'; - -class Super {} -class Malbounded1 implements Super {} // //# static type warning -class Malbounded2 extends Super {} // //# static type warning - -main() { - bool inCheckedMode = false; - try { - String a = 42; //# static type warning - } catch (e) { - inCheckedMode = true; - } - - var expectedError; - if (inCheckedMode) { - expectedError = (e) => e is TypeError; - } else { - expectedError = (e) => e is CastError; - } - - var m = new Malbounded1(); - Expect.throws(() => m as Super, expectedError); - var s = new Super(); - Expect.throws(() => s as Malbounded1, (e) => e is CastError); - Expect.throws(() => s as Malbounded2, expectedError); - Expect.throws(() => s as Super, expectedError); //# static type warning -} diff --git a/tests/language_strong/malbounded_type_test_test.dart b/tests/language_strong/malbounded_type_test_test.dart deleted file mode 100644 index 261fcbb3d82..00000000000 --- a/tests/language_strong/malbounded_type_test_test.dart +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -import 'package:expect/expect.dart'; - -class Super {} -class Malbounded1 implements Super {} // //# 01: static type warning, dynamic type error -class Malbounded1 implements Super {} // //# 02: static type warning -class Malbounded2 extends Super {} // //# 03: static type warning, dynamic type error - -main() { - var m = new Malbounded1(); // //# 01: continued - Expect.isFalse(m is Super); // //# 01: continued - var s = new Super(); - Expect.isFalse(s is Malbounded1); // //# 02: continued - Expect.isFalse(s is Malbounded2); // //# 03: continued - Expect.isFalse(s is Super); // //# 04: static type warning, dynamic type error -} diff --git a/tests/language_strong/malformed2_lib.dart b/tests/language_strong/malformed2_lib.dart deleted file mode 100644 index 44f01abbd3b..00000000000 --- a/tests/language_strong/malformed2_lib.dart +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -part of malformed_test; - -/// [o] is either `null` or `new List()`. -void testValue(var o) { - assert(o == null || o is List); - - test(true, () => o is Unresolved, "$o is Unresolved"); - test(false, () => o is List, "$o is List"); - test(true, () => o is! Unresolved, "$o is! Unresolved"); - test(false, () => o is! List, "$o is List"); - - test(true, () => o as Unresolved, "$o as Unresolved"); - test(false, () => o as List, "$o as List"); - - test(false, () { - try {} on Unresolved catch (e) {} catch (e) {} - }, "on Unresolved catch: Nothing thrown."); - test(true, () { - try { - throw o; - } on Unresolved catch (e) {} catch (e) {} - }, "on Unresolved catch ($o)"); - test(false, () { - try { - throw o; - } on List< - String> catch (e) {} on NullThrownError catch (e) {} on Unresolved catch (e) {} catch (e) {} - }, "on List/NullThrowError catch ($o)"); - test(false, () { - try { - throw o; - } on List< - Unresolved> catch (e) {} on NullThrownError catch (e) {} on Unresolved catch (e) {} catch (e) {} - }, "on List/NullThrowError catch ($o)"); - - test(o != null && inCheckedMode(), () { - Unresolved u = o; - }, "Unresolved u = $o;"); - test(false, () { - List u = o; - }, "List u = $o;"); -} diff --git a/tests/language_strong/malformed2_test.dart b/tests/language_strong/malformed2_test.dart deleted file mode 100644 index 1b263fa13c1..00000000000 --- a/tests/language_strong/malformed2_test.dart +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -library malformed_test; - -// This part includes the actual tests. -part 'malformed2_lib.dart'; //# 00: static type warning - -bool inCheckedMode() { - try { - var i = 42; - String s = i; - } on TypeError catch (e) { - return true; - } - return false; -} - -bool hasFailed = false; - -void fail(String message) { - try { - throw message; - } catch (e, s) { - print(e); - print(s); - } - hasFailed = true; -} - -void checkFailures() { - if (hasFailed) throw 'Test failed.'; -} - -test(bool expectTypeError, f(), [String message]) { - message = message != null ? ' for $message' : ''; - try { - f(); - if (expectTypeError) { - fail('Missing type error$message.'); - } - } on TypeError catch (e) { - if (expectTypeError) { - print('Type error$message: $e'); - } else { - fail('Unexpected type error$message: $e'); - } - } -} - -const Unresolved c1 = 0; //# 01: static type warning, checked mode compile-time error - -void main() { - print(c1); //# 01: continued - testValue(new List()); //# 00: continued - testValue(null); //# 00: continued - checkFailures(); -} diff --git a/tests/language_strong/malformed_inheritance_test.dart b/tests/language_strong/malformed_inheritance_test.dart deleted file mode 100644 index 733202a20d9..00000000000 --- a/tests/language_strong/malformed_inheritance_test.dart +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -// Tests that malformed types used in extends, implements, and with clauses -// cause compile-time errors. - -import 'package:expect/expect.dart'; - -class A {} - -class C - extends Unresolved //# 01: compile-time error - extends A //# 02: static type warning - extends Object with Unresolved //# 03: compile-time error - extends Object with A //# 04: static type warning - implements Unresolved //# 05: compile-time error - implements A //# 06: static type warning - extends A //# 07: compile-time error - extends A //# 08: compile-time error - extends Object with A //# 09: compile-time error - extends Object with A //# 10: compile-time error - implements A //# 11: compile-time error - implements A //# 12: compile-time error -{} - -void main() { - new C(); - Expect.isTrue(new C() is A && new C() is A); //# 02: continued - Expect.isTrue(new C() is A && new C() is A); //# 04: continued - Expect.isTrue(new C() is A && new C() is A); //# 06: continued -} diff --git a/tests/language_strong/malformed_test.dart b/tests/language_strong/malformed_test.dart deleted file mode 100644 index 22851bf3f01..00000000000 --- a/tests/language_strong/malformed_test.dart +++ /dev/null @@ -1,163 +0,0 @@ -// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -// Tests that malformed types are handled as dynamic, and that types with the -// wrong number of type arguments are handled as raw types. - -import 'package:expect/expect.dart'; -import 'package:expect/expect.dart' as prefix; // Define 'prefix'. - -checkIsUnresolved(var v) { - Expect.throws(() => v is Unresolved, (e) => e is TypeError); - Expect.throws(() => v is Unresolved, (e) => e is TypeError); - Expect.throws(() => v is prefix.Unresolved, (e) => e is TypeError); - Expect.throws(() => v is prefix.Unresolved, (e) => e is TypeError); -} - -checkIsListUnresolved(bool expect, var v) { - Expect.equals(expect, v is List); - Expect.equals(expect, v is List>); - Expect.equals(expect, v is List); - Expect.equals(expect, v is List>); - Expect.equals(expect, v is List); -} - -checkIsListDynamic(bool expect, var v) { - checkIsListUnresolved(true, v); - Expect.equals(expect, v is List && v is List); -} - -checkAsUnresolved(var v) { - Expect.throws(() => v as Unresolved, (e) => e is TypeError); - Expect.throws(() => v as Unresolved, (e) => e is TypeError); - Expect.throws(() => v as prefix.Unresolved, (e) => e is TypeError); - Expect.throws(() => v as prefix.Unresolved, (e) => e is TypeError); -} - -checkAsListUnresolved(bool expect, var v) { - if (expect) { - Expect.equals(v, v as List); - Expect.equals(v, v as List>); - Expect.equals(v, v as List); - Expect.equals(v, v as List>); - Expect.equals(v, v as List); - } else { - Expect.throws(() => v as List, (e) => e is CastError); - Expect.throws(() => v as List>, (e) => e is CastError); - Expect.throws(() => v as List, (e) => e is CastError); - Expect.throws( - () => v as List>, (e) => e is CastError); - Expect.throws(() => v as List, (e) => e is CastError); - } -} - -checkIsMapDynamic(bool first, bool second, var v) { - Expect.equals(first, v is Map && v is Map); - Expect.equals(second, v is Map && v is Map); -} - -void main() { - checkIsUnresolved(''); - checkIsUnresolved(0); - checkIsListUnresolved(false, ''); - checkIsListUnresolved(true, new List()); - checkIsListUnresolved(true, new List()); - checkIsListUnresolved(true, new List()); - checkIsListUnresolved(true, new List()); - - checkAsUnresolved(''); - checkAsUnresolved(0); - checkAsListUnresolved(false, ''); - checkAsListUnresolved(true, new List()); - checkAsListUnresolved(true, new List()); - checkAsListUnresolved(true, new List()); - checkAsListUnresolved(true, new List()); - - checkIsListDynamic(true, []); - checkIsListDynamic(true, <>[]); //# 01: compile-time error - checkIsListDynamic(false, []); - checkIsListDynamic(true, []); - checkIsListDynamic(true, >[]); - checkIsListDynamic(true, []); - checkIsListDynamic(true, >[]); - checkIsListDynamic(true, []); - - checkIsListDynamic(true, new List()); - checkIsListDynamic(true, new List<>()); //# 02: compile-time error - checkIsListDynamic(true, new List()); - checkIsListDynamic(true, new List>()); - checkIsListDynamic(true, new List()); - checkIsListDynamic(true, new List>()); - checkIsListDynamic(true, new List()); - - checkIsMapDynamic(true, true, {}); - checkIsMapDynamic(true, true, {}); - checkIsMapDynamic(true, true, <>{}); //# 03: compile-time error - checkIsMapDynamic(true, true, {}); - checkIsMapDynamic(false, false, {}); - checkIsMapDynamic(true, true, {}); - checkIsMapDynamic(true, false, {}); - checkIsMapDynamic(false, true, >{}); - checkIsMapDynamic(true, false, {}); - checkIsMapDynamic(false, true, >{}); - - checkIsMapDynamic(true, true, new Map()); - checkIsMapDynamic(true, true, new Map<>); //# 04: compile-time error - checkIsMapDynamic(true, true, new Map()); - checkIsMapDynamic(false, false, new Map()); - checkIsMapDynamic(true, true, new Map()); - checkIsMapDynamic(true, false, new Map()); - checkIsMapDynamic(false, true, new Map>()); - checkIsMapDynamic(true, false, new Map()); - checkIsMapDynamic(false, true, new Map>()); - - Expect.throws(() => new Unresolved(), (e) => true); - Expect.throws(() => new Unresolved(), (e) => true); - Expect.throws(() => new prefix.Unresolved(), (e) => true); - Expect.throws(() => new prefix.Unresolved(), (e) => true); - - // The expression 'undeclared_prefix.Unresolved()' is parsed as the invocation - // of the named constructor 'Unresolved' on the type 'undeclared_prefix'. - Expect.throws(() => new undeclared_prefix.Unresolved(), (e) => true); - // The expression 'undeclared_prefix.Unresolved' is a malformed type. - Expect.throws(() => new undeclared_prefix.Unresolved(), (e) => true); - - try { - try { - throw 'foo'; - } on Unresolved catch (e) { - Expect.fail("This code shouldn't be executed"); - } - Expect.fail("This code shouldn't be executed"); - } on TypeError catch (e) {} - try { - try { - throw 'foo'; - } on Unresolved catch (e) { - Expect.fail("This code shouldn't be executed"); - } - Expect.fail("This code shouldn't be executed"); - } on TypeError catch (e) {} - try { - try { - throw 'foo'; - } on prefix.Unresolved catch (e) { - Expect.fail("This code shouldn't be executed"); - } - Expect.fail("This code shouldn't be executed"); - } on TypeError catch (e) {} - try { - try { - throw 'foo'; - } on prefix.Unresolved catch (e) { - Expect.fail("This code shouldn't be executed"); - } - Expect.fail("This code shouldn't be executed"); - } on TypeError catch (e) {} - try { - throw 'foo'; - } - on undeclared_prefix.Unresolved // //# 06: runtime error - catch (e) {} -}