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

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

Issue 1078873003: Report compile-time error if using `this` implicitly in initializers (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 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/members.dart ('k') | tests/co19/co19-dart2js.status » ('j') | 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 947141959a095a6b27787864827c1475335dfa7e..a9cad07c86704eb3d68b3dc82df16ed1d4dbfa4f 100644
--- a/pkg/compiler/lib/src/warnings.dart
+++ b/pkg/compiler/lib/src/warnings.dart
@@ -155,6 +155,18 @@ class MessageKind {
static const MessageKind CANNOT_RESOLVE = const MessageKind(
"Cannot resolve '#{name}'.");
+ static const MessageKind CANNOT_RESOLVE_IN_INITIALIZER = const MessageKind(
+ "Cannot resolve '#{name}'. It would be implicitly looked up on this "
+ "instance, but instances are not available in initializers.",
+ howToFix: "Try correcting the unresolved reference or move the "
+ "initialization to a constructor body.",
+ examples: const ["""
+class A {
+ var test = unresolvedName;
+}
+main() => new A();
+"""]);
+
static const MessageKind CANNOT_RESOLVE_CONSTRUCTOR = const MessageKind(
"Cannot resolve constructor '#{constructorName}'.");
« no previous file with comments | « pkg/compiler/lib/src/resolution/members.dart ('k') | tests/co19/co19-dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698