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

Unified Diff: runtime/vm/parser.cc

Issue 319833002: Improve error message and suggest workaround for mixin limitation. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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 | no next file » | 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 37056)
+++ runtime/vm/parser.cc (working copy)
@@ -2542,8 +2542,15 @@
// TODO(hausner): Remove this limitation if the language spec indeed
// allows optional parameters.
if (func.HasOptionalParameters()) {
+ const Class& super_class = Class::Handle(I, current_class().SuperClass());
ErrorMsg(ctor_pos,
- "forwarding constructors must not have optional parameters");
+ "cannot generate an implicit mixin application constructor "
+ "forwarding to a super class constructor with optional "
+ "parameters; add a constructor without optional parameters "
+ "to class '%s' that redirects to the constructor with optional "
+ "parameters and invoke it via super from a constructor of the "
+ "class extending the mixin application",
+ String::Handle(I, super_class.Name()).ToCString());
}
// Prepare user-defined arguments to be forwarded to super call.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698