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

Unified Diff: pkg/compiler/lib/src/resolution/members.dart

Issue 1261623002: Add AccessSemantics.INVALID for invalid expressions. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 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/resolution/members.dart
diff --git a/pkg/compiler/lib/src/resolution/members.dart b/pkg/compiler/lib/src/resolution/members.dart
index ea44ed2ca41fcd3f3e2761ab40d116fec0303f8c..30dff7e7ff96860554bfe6082db91514f075719d 100644
--- a/pkg/compiler/lib/src/resolution/members.dart
+++ b/pkg/compiler/lib/src/resolution/members.dart
@@ -1979,11 +1979,14 @@ class ResolverVisitor extends MappingVisitor<ResolutionResult> {
Name name,
PrefixElement prefix) {
if ((ElementCategory.PREFIX & allowedCategory) == 0) {
- compiler.reportError(
+ ErroneousElement error = reportAndCreateErroneousElement(
node,
+ name.text,
MessageKind.PREFIX_AS_EXPRESSION,
- {'prefix': name});
- return const NoneResult();
+ {'prefix': name},
+ isError: true);
+ return handleErroneousAccess(
+ node, name, error, new StaticAccess.invalid(error));
}
if (prefix.isDeferred) {
// TODO(johnniwinther): Remove this when deferred access is detected
@@ -2062,8 +2065,7 @@ class ResolverVisitor extends MappingVisitor<ResolutionResult> {
name.text,
MessageKind.THIS_PROPERTY, {},
isError: true);
- // TODO(johnniwinther): Support `this` as property as an [AccessSemantics].
- AccessSemantics accessSemantics = new StaticAccess.unresolved(error);
+ AccessSemantics accessSemantics = new StaticAccess.invalid(error);
return handleErroneousAccess(node, name, error, accessSemantics);
}
« no previous file with comments | « pkg/compiler/lib/src/resolution/access_semantics.dart ('k') | pkg/compiler/lib/src/resolution/semantic_visitor.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698