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

Unified Diff: lib/compiler/implementation/resolver.dart

Issue 10905062: Fix issue 4361 by checking in the resolver if the getter/setter exists. (Closed) Base URL: http://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 | lib/compiler/implementation/warnings.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/resolver.dart
===================================================================
--- lib/compiler/implementation/resolver.dart (revision 11766)
+++ lib/compiler/implementation/resolver.dart (working copy)
@@ -1329,6 +1329,10 @@
&& target.kind == ElementKind.ABSTRACT_FIELD) {
AbstractFieldElement field = target;
target = field.getter;
+ if (Element.isInvalid(target) && !inInstanceContext) {
+ // TODO(karlklose): make this a runtime error.
+ error(node.selector, MessageKind.CANNOT_RESOLVE_GETTER);
+ }
}
bool resolvedArguments = false;
@@ -1390,10 +1394,20 @@
Element target = resolveSend(node);
Element setter = target;
Element getter = target;
+ String source = node.assignmentOperator.source.stringValue;
+ bool isComplex = source !== '=';
if (target != null && target.kind == ElementKind.ABSTRACT_FIELD) {
AbstractFieldElement field = target;
setter = field.setter;
getter = field.getter;
+ if (Element.isInvalid(setter) && !inInstanceContext) {
+ // TODO(karlklose): make this a runtime error.
+ error(node.selector, MessageKind.CANNOT_RESOLVE_SETTER);
+ }
+ if (isComplex && Element.isInvalid(getter) && !inInstanceContext) {
+ // TODO(karlklose): make this a runtime error.
+ error(node.selector, MessageKind.CANNOT_RESOLVE_GETTER);
+ }
}
visit(node.argumentsNode);
@@ -1403,8 +1417,6 @@
// unqualified.
Selector selector = mapping.getSelector(node);
- String source = node.assignmentOperator.source.stringValue;
- bool isComplex = source !== '=';
if (isComplex) {
if (selector.isSetter()) {
// TODO(kasperl): We're registering the getter selector for
« no previous file with comments | « no previous file | lib/compiler/implementation/warnings.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698