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

Unified Diff: runtime/vm/class_finalizer.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 | « no previous file | runtime/vm/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/class_finalizer.cc
===================================================================
--- runtime/vm/class_finalizer.cc (revision 24703)
+++ runtime/vm/class_finalizer.cc (working copy)
@@ -1809,19 +1809,10 @@
// A class is marked as constant if it has one constant constructor.
-// A constant class:
-// - may extend only const classes.
-// - has only const instance fields.
+// A constant class can only have final instance fields.
// Note: we must check for cycles before checking for const properties.
void ClassFinalizer::CheckForLegalConstClass(const Class& cls) {
ASSERT(cls.is_const());
- const Class& super = Class::Handle(cls.SuperClass());
- if (!super.IsNull() && !super.is_const()) {
- String& name = String::Handle(super.Name());
- const Script& script = Script::Handle(cls.script());
- ReportError(script, cls.token_pos(),
- "superclass '%s' must be const", name.ToCString());
- }
const Array& fields_array = Array::Handle(cls.fields());
intptr_t len = fields_array.Length();
Field& field = Field::Handle();
« no previous file with comments | « no previous file | runtime/vm/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698