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

Unified Diff: compiler/java/com/google/dart/compiler/resolver/ResolutionContext.java

Issue 12045032: Issue 7980. Report problem when type 'dynamic' is shadowed. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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 | compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « no previous file | compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698