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

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

Issue 9699030: Use NodeElement in SupertypeResolver (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 9 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
Index: compiler/java/com/google/dart/compiler/resolver/TopLevelElementBuilder.java
diff --git a/compiler/java/com/google/dart/compiler/resolver/TopLevelElementBuilder.java b/compiler/java/com/google/dart/compiler/resolver/TopLevelElementBuilder.java
index c0bee341d8af8448247837556e88460b50ada269..f025dee2ed779c40497bcc962113d81e0eec6e42 100644
--- a/compiler/java/com/google/dart/compiler/resolver/TopLevelElementBuilder.java
+++ b/compiler/java/com/google/dart/compiler/resolver/TopLevelElementBuilder.java
@@ -9,15 +9,13 @@ import com.google.dart.compiler.DartCompilationError;
import com.google.dart.compiler.DartCompilerContext;
import com.google.dart.compiler.DartCompilerListener;
import com.google.dart.compiler.ErrorCode;
+import com.google.dart.compiler.ast.ASTVisitor;
import com.google.dart.compiler.ast.DartClass;
-import com.google.dart.compiler.ast.DartDeclaration;
-import com.google.dart.compiler.ast.DartExpression;
import com.google.dart.compiler.ast.DartField;
import com.google.dart.compiler.ast.DartFieldDefinition;
import com.google.dart.compiler.ast.DartFunctionTypeAlias;
import com.google.dart.compiler.ast.DartMethodDefinition;
import com.google.dart.compiler.ast.DartNode;
-import com.google.dart.compiler.ast.ASTVisitor;
import com.google.dart.compiler.ast.DartTypeParameter;
import com.google.dart.compiler.ast.DartUnit;
import com.google.dart.compiler.ast.LibraryUnit;
@@ -122,17 +120,12 @@ public class TopLevelElementBuilder {
/**
* Reports {@link ResolverErrorCode#DUPLICATE_TOP_LEVEL_DEFINITION} for given named element.
*/
- @SuppressWarnings("unchecked")
private void reportDuplicateDeclaration(DartCompilerListener listener, Element element) {
- DartNode node = element.getNode();
- if (node instanceof DartDeclaration) {
- DartNode nameNode = ((DartDeclaration<DartExpression>) node).getName();
- compilationError(
- listener,
- nameNode.getSourceInfo(),
- ResolverErrorCode.DUPLICATE_TOP_LEVEL_DEFINITION,
- nameNode);
- }
+ compilationError(
+ listener,
+ element.getNameLocation(),
+ ResolverErrorCode.DUPLICATE_TOP_LEVEL_DEFINITION,
+ element.getName());
}
/**

Powered by Google App Engine
This is Rietveld 408576698