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

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

Issue 1154743004: Test (and fix some) invalid assignments. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. Created 5 years, 7 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 | « no previous file | pkg/compiler/lib/src/resolution/send_resolver.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 762c6f223b6ca06e6575e3d694e0215f77ad6646..45511338dd9056df8b7f432650062670d3b89248 100644
--- a/pkg/compiler/lib/src/resolution/members.dart
+++ b/pkg/compiler/lib/src/resolution/members.dart
@@ -2868,10 +2868,12 @@ class ResolverVisitor extends MappingVisitor<ResolutionResult> {
} else if (target.isAbstractField) {
AbstractFieldElement field = target;
target = field.getter;
- if (target == null && !inInstanceContext) {
- registry.registerThrowNoSuchMethod();
- target = reportAndCreateErroneousElement(node.selector, field.name,
- MessageKind.CANNOT_RESOLVE_GETTER, const {});
+ if (target == null) {
+ if (!inInstanceContext || field.isTopLevel || field.isStatic) {
+ registry.registerThrowNoSuchMethod();
+ target = reportAndCreateErroneousElement(node.selector, field.name,
+ MessageKind.CANNOT_RESOLVE_GETTER, const {});
+ }
}
} else if (target.isTypeVariable) {
ClassElement cls = target.enclosingClass;
« no previous file with comments | « no previous file | pkg/compiler/lib/src/resolution/send_resolver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698