Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(223)

Side by Side Diff: tests/language/call_constructor_on_unresolvable_class_test.dart

Issue 10868069: Throw a runtime error when trying to call a constructor of a class that could not be resolved. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 // Check that calling a constructor of a class that cannot be resolved causes
6 // a runtime error.
7
8 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.
9
10 main() {
11 if (never()) {
12 // These should not produce errors because the calls are never executed.
13 new A(); /// 01: static type warning
14 new A.foo(); /// 02: static type warning
15 new library.A(); /// 03: static type warning
16 }
17
18 new A(); /// 04: runtime error
19 new A.foo(); /// 05: runtime error
20 new library.A(); /// 06: runtime error
21 try { /// 07: runtime error
22 new A(); /// 07: continued
23 } catch (e) { /// 07: continued
24 } /// 07: continued
25 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698