Chromium Code Reviews| Index: tests/language/call_constructor_on_unresolvable_class_test.dart |
| diff --git a/tests/language/call_constructor_on_unresolvable_class_test.dart b/tests/language/call_constructor_on_unresolvable_class_test.dart |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..a5b59489289714210e9b3b3e803dcc7a39075a6d |
| --- /dev/null |
| +++ b/tests/language/call_constructor_on_unresolvable_class_test.dart |
| @@ -0,0 +1,25 @@ |
| +// Copyright (c) 2012, 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. |
| + |
| +// Check that calling a constructor of a class that cannot be resolved causes |
| +// a runtime error. |
| + |
| +never() => false; |
|
ngeoffray
2012/08/24 15:43:48
This will be inlined and the code below line 12 wi
karlklose
2012/08/28 09:09:15
Done.
|
| + |
| +main() { |
| + if (never()) { |
| + // These should not produce errors because the calls are never executed. |
| + new A(); /// 01: static type warning |
| + new A.foo(); /// 02: static type warning |
| + new library.A(); /// 03: static type warning |
| + } |
| + |
| + new A(); /// 04: runtime error |
| + new A.foo(); /// 05: runtime error |
| + new library.A(); /// 06: runtime error |
| + try { /// 07: runtime error |
| + new A(); /// 07: continued |
| + } catch (e) { /// 07: continued |
| + } /// 07: continued |
| +} |