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

Unified Diff: runtime/vm/class_finalizer.cc

Issue 1699233002: Revert "Compile-time error if mixin class has a fact (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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
Index: runtime/vm/class_finalizer.cc
diff --git a/runtime/vm/class_finalizer.cc b/runtime/vm/class_finalizer.cc
index ebf986896e5ad1901c0a4d3a5121d1756d1b3e71..c7cf184a9976dffb72798613e0eb0d6204a6d6c5 100644
--- a/runtime/vm/class_finalizer.cc
+++ b/runtime/vm/class_finalizer.cc
@@ -2227,23 +2227,12 @@ void ClassFinalizer::ApplyMixinMembers(const Class& cls) {
const intptr_t num_functions = functions.Length();
for (intptr_t i = 0; i < num_functions; i++) {
func ^= functions.At(i);
- if (func.IsFactory() || func.IsGenerativeConstructor()) {
+ if (func.IsGenerativeConstructor()) {
// A mixin class must not have explicit constructors.
if (!func.IsImplicitConstructor()) {
- const char* ctr_kind = func.IsFactory() ? "factory" : "constructor";
Ivan Posva 2016/02/17 07:51:26 You need to preserve the improved error message be
Jacob 2016/02/19 20:53:03 Done.
- const Script& script = Script::Handle(cls.script());
- const Error& error = Error::Handle(
- LanguageError::NewFormatted(Error::Handle(),
- script, func.token_pos(), Report::AtLocation,
- Report::kError, Heap::kNew,
- "%s '%s' is illegal in mixin class %s",
- ctr_kind,
- String::Handle(func.PrettyName()).ToCString(),
- String::Handle(zone, mixin_cls.Name()).ToCString()));
-
- ReportErrors(error, cls, cls.token_pos(),
- "mixin class '%s' must not have constructors",
- String::Handle(zone, mixin_cls.Name()).ToCString());
+ ReportError(cls, cls.token_pos(),
+ "mixin class '%s' must not have constructors\n",
+ String::Handle(zone, mixin_cls.Name()).ToCString());
}
continue; // Skip the implicit constructor.
}
« no previous file with comments | « no previous file | tests/language/language_analyzer2.status » ('j') | tests/language/mixin_illegal_constructor_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698