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

Unified Diff: lib/compiler/implementation/dart_backend/placeholder_collector.dart

Issue 10911312: Properly process constructs like Class.getter++ where there is no setter. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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 | tests/language/language.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/dart_backend/placeholder_collector.dart
diff --git a/lib/compiler/implementation/dart_backend/placeholder_collector.dart b/lib/compiler/implementation/dart_backend/placeholder_collector.dart
index b2197e20ed52637a1fd4724035c7b691f1a6bd1a..21d08ced41747468a001ae963d6ed3cc23a257c1 100644
--- a/lib/compiler/implementation/dart_backend/placeholder_collector.dart
+++ b/lib/compiler/implementation/dart_backend/placeholder_collector.dart
@@ -375,10 +375,19 @@ class PlaceholderCollector extends AbstractVisitor {
}
visitSendSet(SendSet send) {
- final element = treeElements[send];
- if (!Elements.isUnresolved(element)) {
+ Element element = treeElements[send];
+ if (Elements.isErroneousElement(element)) {
+ // Complicated case: constructs like receiver.selector++ can resolve
+ // to ErroneousElement. Fortunately, receiver.selector still
+ // can be resoved via treeElements[send.selector], that's all
+ // that is needed to rename the construct properly.
+ element = treeElements[send.selector];
+ }
+ if (element === null) {
+ if (send.receiver !== null) tryMakeMemberPlaceholder(send.selector);
+ } else if (!element.isErroneous()) {
if (Elements.isStaticOrTopLevel(element)) {
- assert(element is VariableElement || element.isSetter());
+ assert(element is VariableElement || element.isAccessor());
makeElementPlaceholder(send.selector, element);
} else {
assert(send.selector is Identifier);
@@ -388,10 +397,6 @@ class PlaceholderCollector extends AbstractVisitor {
tryMakeLocalPlaceholder(element, send.selector);
}
}
- } else {
- if (send.receiver !== null) {
- tryMakeMemberPlaceholder(send.selector);
- }
}
send.visitChildren(this);
}
« no previous file with comments | « no previous file | tests/language/language.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698