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/typechecker.dart

Issue 1094903002: Better hints for await in non-async functions (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
Index: pkg/compiler/lib/src/typechecker.dart
diff --git a/pkg/compiler/lib/src/typechecker.dart b/pkg/compiler/lib/src/typechecker.dart
index c126bd237deba192ee612929b857b15d0eba502e..781301c6427dcec6940fc62acc185b8ca81f929a 100644
--- a/pkg/compiler/lib/src/typechecker.dart
+++ b/pkg/compiler/lib/src/typechecker.dart
@@ -817,6 +817,14 @@ class TypeCheckerVisitor extends Visitor<DartType> {
// getter.
reportTypeWarning(node, MessageKind.GETTER_NOT_FOUND,
{'className': receiverType.name, 'memberName': name});
+ } else if (name == 'await') {
+ var enclosingFunctionName = executableContext.name;
+ reportTypeWarning(node, MessageKind.AWAIT_MEMBER_NOT_FOUND,
+ {'className': receiverType.name,
+ 'enclosingFunctionText': enclosingFunctionName == ''
+ ? 'the enclosing function'
+ : "'$enclosingFunctionName'"
+ });
} else {
reportTypeWarning(node, MessageKind.MEMBER_NOT_FOUND,
{'className': receiverType.name, 'memberName': name});

Powered by Google App Engine
This is Rietveld 408576698