 Chromium Code Reviews
 Chromium Code Reviews Issue 930703002:
  Constant top-level variables should not have setters.  (Closed) 
  Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
    
  
    Issue 930703002:
  Constant top-level variables should not have setters.  (Closed) 
  Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart| Index: pkg/analyzer/lib/src/generated/element_resolver.dart | 
| diff --git a/pkg/analyzer/lib/src/generated/element_resolver.dart b/pkg/analyzer/lib/src/generated/element_resolver.dart | 
| index 9ecb2326b4d8b118b945590aff58b7a704ecf0cb..833406ff182567dcba8fd4d60928dd1a845bc17e 100644 | 
| --- a/pkg/analyzer/lib/src/generated/element_resolver.dart | 
| +++ b/pkg/analyzer/lib/src/generated/element_resolver.dart | 
| @@ -2493,22 +2493,22 @@ class ElementResolver extends SimpleAstVisitor<Object> { | 
| } | 
| /** | 
| - * Given an invocation of the form 'C.x()' where 'C' is a class, find and return the element 'x' | 
| - * in 'C'. | 
| - * | 
| - * @param classElement the class element | 
| - * @param nameNode the member name node | 
| + * Given that we are accessing a property of the given [classElement] with | 
| + * the given [propertyName], return the element that represents the property. | 
| */ | 
| Element _resolveElement(ClassElementImpl classElement, | 
| - SimpleIdentifier nameNode) { | 
| - String name = nameNode.name; | 
| - Element element = classElement.getMethod(name); | 
| - if (element == null && nameNode.inSetterContext()) { | 
| + SimpleIdentifier propertyName) { | 
| + String name = propertyName.name; | 
| + Element element = null; | 
| + if (propertyName.inSetterContext()) { | 
| element = classElement.getSetter(name); | 
| } | 
| - if (element == null && nameNode.inGetterContext()) { | 
| + if (element == null) { | 
| element = classElement.getGetter(name); | 
| } | 
| + if (element == null) { | 
| + element = classElement.getMethod(name); | 
| + } | 
| 
Brian Wilkerson
2015/02/15 22:49:43
I don't really understand why it was necessary to
 
scheglov
2015/02/16 05:35:53
It corresponds to _resolveProperty() now.
 | 
| if (element != null && element.isAccessibleIn(_definingLibrary)) { | 
| return element; | 
| } |