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

Unified Diff: pkg/compiler/lib/src/warnings.dart

Issue 1156923007: Improve error for non-const implicit super constructor (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 7 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 | « pkg/compiler/lib/src/resolution/constructors.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/warnings.dart
diff --git a/pkg/compiler/lib/src/warnings.dart b/pkg/compiler/lib/src/warnings.dart
index d7f1403a352bf965a0aee41014a9b19d55382ca2..dee59c6fbadca66a3ca867d78806d5401da1ea2a 100644
--- a/pkg/compiler/lib/src/warnings.dart
+++ b/pkg/compiler/lib/src/warnings.dart
@@ -481,6 +481,21 @@ main() => new C();"""]);
static const MessageKind CONST_CALLS_NON_CONST = const MessageKind(
"'const' constructor cannot call a non-const constructor.");
+ static const MessageKind CONST_CALLS_NON_CONST_FOR_IMPLICIT =
+ const MessageKind(
+ "'const' constructor cannot call implicit "
+ "super non-const constructor.",
Johnni Winther 2015/05/29 08:24:04 The wording makes it sound like the constructor (a
Siggi Cherem (dart-lang) 2015/05/29 16:09:34 Good point. Rephrased.
+ howToFix: "Try making the super constructor const",
Johnni Winther 2015/05/29 08:24:04 'const' -> 'const.'
Siggi Cherem (dart-lang) 2015/05/29 16:09:34 Done.
+ examples: const ["""
+class C {
+ C(); // missing const
+}
+class D extends C {
+ final d;
+ const D(this.d);
+}
+main() => new D(0);"""]);
+
static const MessageKind CONST_CONSTRUCTOR_WITH_NONFINAL_FIELDS =
const MessageKind(
"Can't declare constructor 'const' on class #{className} "
« no previous file with comments | « pkg/compiler/lib/src/resolution/constructors.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698