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

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

Issue 10986026: Issue 5440. Fixes for exceptions during resolving (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 | compiler/java/com/google/dart/compiler/type/TypeAnalyzer.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/Resolver.java
diff --git a/compiler/java/com/google/dart/compiler/resolver/Resolver.java b/compiler/java/com/google/dart/compiler/resolver/Resolver.java
index d556533a32f0934a2d6266ed7c56f47c718da16e..339805f1a837c16fde60e0858542902fc23dff3d 100644
--- a/compiler/java/com/google/dart/compiler/resolver/Resolver.java
+++ b/compiler/java/com/google/dart/compiler/resolver/Resolver.java
@@ -1197,8 +1197,16 @@ public class Resolver {
} else {
element = checkResolvedIdentifier(x, isQualifier, scope, name, element);
}
+
+ if (ElementKind.of(element) == ElementKind.DUPLICATE) {
+ DuplicateElement duplicateElement = (DuplicateElement) element;
+ List<String> locations = duplicateElement.getLocations();
+ onError(x, ResolverErrorCode.DUPLICATE_IMPORTED_NAME, element.getName(), locations.size(),
+ locations);
+ return null;
+ }
- if (inInitializer && (element != null && element.getKind().equals(ElementKind.FIELD))) {
+ if (inInitializer && ElementKind.of(element) == ElementKind.FIELD) {
if (!element.getModifiers().isStatic() && !Elements.isTopLevel(element)) {
onError(x, ResolverErrorCode.CANNOT_ACCESS_FIELD_IN_INIT);
}
« no previous file with comments | « no previous file | compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698