Index: compiler/java/com/google/dart/compiler/resolver/ResolutionContext.java |
diff --git a/compiler/java/com/google/dart/compiler/resolver/ResolutionContext.java b/compiler/java/com/google/dart/compiler/resolver/ResolutionContext.java |
index 03e72ff4847ce267bb4e7566504680d5ff39dd9a..78897322e3e6172a0067500572f71fdad6397826 100644 |
--- a/compiler/java/com/google/dart/compiler/resolver/ResolutionContext.java |
+++ b/compiler/java/com/google/dart/compiler/resolver/ResolutionContext.java |
@@ -314,13 +314,16 @@ public class ResolutionContext implements ResolutionErrorListener { |
* Interpret this node as a name reference, |
*/ |
Element resolveName(DartNode node) { |
- if (Elements.isIdentifierName(node, "void")) { |
- return typeProvider.getVoidType().getElement(); |
- } |
- if (Elements.isIdentifierName(node, "dynamic")) { |
- return typeProvider.getDynamicType().getElement(); |
+ Element result = node.accept(new Selector()); |
+ if (result == null) { |
+ if (Elements.isIdentifierName(node, "void")) { |
+ return typeProvider.getVoidType().getElement(); |
+ } |
+ if (Elements.isIdentifierName(node, "dynamic")) { |
+ return typeProvider.getDynamicType().getElement(); |
+ } |
} |
- return node.accept(new Selector()); |
+ return result; |
} |
MethodElement declareFunction(DartFunctionExpression node) { |