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

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

Issue 1423623008: Improve messages and static use for super/this-calls. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comment. Created 5 years, 1 month 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/ssa/builder.dart ('k') | tests/compiler/dart2js/diagnose_ambiguous_test.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 0a0596ce0397a20f1e411dc3c08afe8c46ab70b2..71a0fc1bfb225775bd48c2618ce1cac89965571d 100644
--- a/pkg/compiler/lib/src/typechecker.dart
+++ b/pkg/compiler/lib/src/typechecker.dart
@@ -1198,8 +1198,15 @@ class TypeCheckerVisitor extends Visitor<DartType> {
Identifier selector = node.selector.asIdentifier();
if (Elements.isClosureSend(node, element)) {
if (element != null) {
- // foo() where foo is a local or a parameter.
- return analyzeInvocation(node, createPromotedAccess(element));
+ if (element.isError) {
+ // foo() where foo is erroneous
+ return analyzeInvocation(node, const DynamicAccess());
+ } else {
+ assert(invariant(node, element.isLocal,
+ message: "Unexpected element $element in closure send."));
+ // foo() where foo is a local or a parameter.
+ return analyzeInvocation(node, createPromotedAccess(element));
+ }
} else {
// exp() where exp is some complex expression like (o) or foo().
DartType type = analyze(node.selector);
« no previous file with comments | « pkg/compiler/lib/src/ssa/builder.dart ('k') | tests/compiler/dart2js/diagnose_ambiguous_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698