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

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

Issue 8632020: Make method overrides with differing parameters a compile-time error (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Report on function name, not entire function! Created 9 years 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/Elements.java
diff --git a/compiler/java/com/google/dart/compiler/resolver/Elements.java b/compiler/java/com/google/dart/compiler/resolver/Elements.java
index 906407103377a90da773e4eb67aeb09815ce2695..f9a37350ce250fca438fc8153af8486ae255b760 100644
--- a/compiler/java/com/google/dart/compiler/resolver/Elements.java
+++ b/compiler/java/com/google/dart/compiler/resolver/Elements.java
@@ -56,6 +56,16 @@ public class Elements {
return new LibraryElementImplementation(libraryUnit);
}
+ public static LibraryElement getLibraryElement(Element element) {
+ do {
+ if (ElementKind.of(element).equals(ElementKind.LIBRARY)) {
+ break;
+ }
+ element = element.getEnclosingElement();
+ } while (element != null && element.getEnclosingElement() != element);
+ return (LibraryElement) element;
+ }
+
@VisibleForTesting
public static MethodElement methodElement(DartFunctionExpression node, String name) {
return new MethodElementImplementation(node, name, Modifiers.NONE);

Powered by Google App Engine
This is Rietveld 408576698