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

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
« no previous file with comments | « pkg/compiler/lib/src/resolution/members.dart ('k') | pkg/compiler/lib/src/warnings.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..82d829164ac9c90eddf7add4120202bd9f628c5c 100644
--- a/pkg/compiler/lib/src/typechecker.dart
+++ b/pkg/compiler/lib/src/typechecker.dart
@@ -817,6 +817,17 @@ class TypeCheckerVisitor extends Visitor<DartType> {
// getter.
reportTypeWarning(node, MessageKind.GETTER_NOT_FOUND,
{'className': receiverType.name, 'memberName': name});
+ } else if (name == 'await') {
+ Map arguments = {'className': receiverType.name};
+ String functionName = executableContext.name;
+ MessageKind kind;
+ if (functionName == '') {
+ kind = MessageKind.AWAIT_MEMBER_NOT_FOUND_IN_CLOSURE;
+ } else {
+ kind = MessageKind.AWAIT_MEMBER_NOT_FOUND;
+ arguments['functionName'] = functionName;
+ }
+ reportTypeWarning(node, kind, arguments);
} else {
reportTypeWarning(node, MessageKind.MEMBER_NOT_FOUND,
{'className': receiverType.name, 'memberName': name});
« no previous file with comments | « pkg/compiler/lib/src/resolution/members.dart ('k') | pkg/compiler/lib/src/warnings.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698