Index: pkg/compiler/lib/src/warnings.dart |
diff --git a/pkg/compiler/lib/src/warnings.dart b/pkg/compiler/lib/src/warnings.dart |
index a9cad07c86704eb3d68b3dc82df16ed1d4dbfa4f..43c4efad5f9c49db6c42a294352f0903e43e3e27 100644 |
--- a/pkg/compiler/lib/src/warnings.dart |
+++ b/pkg/compiler/lib/src/warnings.dart |
@@ -121,6 +121,22 @@ class MessageKind { |
static const MessageKind MEMBER_NOT_FOUND = const MessageKind( |
"No member named '#{memberName}' in class '#{className}'."); |
+ static const MessageKind AWAIT_MEMBER_NOT_FOUND = const MessageKind( |
+ "No member named 'await' in class '#{className}'.", |
+ howToFix: "Did you mean to add the 'async' marker " |
+ "to #{enclosingFunctionText}?", |
+ examples: const [""" |
+class A { |
+ m() => await -3; |
+} |
+main() => new A().m(); |
+""", """ |
+class A { |
+ m() => () => await -3; |
+} |
+main() => new A().m(); |
+"""]); |
+ |
static const MessageKind METHOD_NOT_FOUND = const MessageKind( |
"No method named '#{memberName}' in class '#{className}'."); |
@@ -155,6 +171,16 @@ class MessageKind { |
static const MessageKind CANNOT_RESOLVE = const MessageKind( |
"Cannot resolve '#{name}'."); |
+ static const MessageKind CANNOT_RESOLVE_AWAIT = const MessageKind( |
+ "Cannot resolve '#{name}'.", |
+ howToFix: "Did you mean to add the 'async' marker " |
+ "to #{enclosingFunctionText}?", |
+ examples: const [ |
+ "main() => await -3;", |
+ "main() { (() => await -3)(); }", |
+ "foo() => await -3; main() => foo();" |
+ ]); |
+ |
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.", |