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

Unified Diff: runtime/vm/parser.cc

Issue 18558002: Const constructor must have const super initializer (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/class_finalizer.cc ('k') | tests/language/const_constructor_super_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
===================================================================
--- runtime/vm/parser.cc (revision 24703)
+++ runtime/vm/parser.cc (working copy)
@@ -1805,6 +1805,10 @@
"unresolved implicit call to super constructor '%s()'",
String::Handle(super_class.Name()).ToCString());
}
+ if (current_function().is_const() && !super_ctor.is_const()) {
+ ErrorMsg(supercall_pos, "implicit call to non-const super constructor");
+ }
+
String& error_message = String::Handle();
if (!super_ctor.AreValidArguments(arguments->length(),
arguments->names(),
@@ -1863,6 +1867,9 @@
"super class constructor '%s' not found",
ctor_name.ToCString());
}
+ if (current_function().is_const() && !super_ctor.is_const()) {
+ ErrorMsg(supercall_pos, "super constructor must be const");
+ }
String& error_message = String::Handle();
if (!super_ctor.AreValidArguments(arguments->length(),
arguments->names(),
« no previous file with comments | « runtime/vm/class_finalizer.cc ('k') | tests/language/const_constructor_super_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698