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

Unified Diff: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/verifier/ErrorVerifier.java

Issue 296193008: Generate proper override warnings when conflicting members are inherited. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 7 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: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/verifier/ErrorVerifier.java
diff --git a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/verifier/ErrorVerifier.java b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/verifier/ErrorVerifier.java
index 0a323aa0d396a41129f576fb417f6339b13cf6b3..e61d0ee0d4dfb04be268d404caa0b060dd020a36 100644
--- a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/verifier/ErrorVerifier.java
+++ b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/verifier/ErrorVerifier.java
@@ -1614,11 +1614,11 @@ public class ErrorVerifier extends RecursiveAstVisitor<Void> {
//
// Compute the overridden executable from the InheritanceManager
//
- ExecutableElement overriddenExecutable = inheritanceManager.lookupInheritance(
+ ArrayList<ExecutableElement> overriddenExecutables = inheritanceManager.lookupOverrides(
enclosingClass,
executableElement.getName());
- if (overriddenExecutable == null) {
+ if (overriddenExecutables.isEmpty()) {
// Nothing is overridden, so we just have to check if the new name collides
// with a static defined in the superclass.
// TODO(paulberry): currently we don't do this check if the new element
@@ -1628,34 +1628,17 @@ public class ErrorVerifier extends RecursiveAstVisitor<Void> {
errorNameTarget);
}
- //
- // If the result is a MultiplyInheritedExecutableElement call
- // checkForAllInvalidOverrideErrorCodes on all of the elements, until an error is found.
- //
- if (overriddenExecutable instanceof MultiplyInheritedExecutableElement) {
- MultiplyInheritedExecutableElement multiplyInheritedElement = (MultiplyInheritedExecutableElement) overriddenExecutable;
- ExecutableElement[] overriddenElement = multiplyInheritedElement.getInheritedElements();
- for (int i = 0; i < overriddenElement.length; i++) {
- if (checkForAllInvalidOverrideErrorCodes(
- executableElement,
- overriddenElement[i],
- parameters,
- parameterLocations,
- errorNameTarget)) {
- return true;
- }
+ for (ExecutableElement overriddenElement : overriddenExecutables) {
+ if (checkForAllInvalidOverrideErrorCodes(
+ executableElement,
+ overriddenElement,
+ parameters,
+ parameterLocations,
+ errorNameTarget)) {
+ return true;
}
- return false;
}
- //
- // Otherwise, just call checkForAllInvalidOverrideErrorCodes.
- //
- return checkForAllInvalidOverrideErrorCodes(
- executableElement,
- overriddenExecutable,
- parameters,
- parameterLocations,
- errorNameTarget);
+ return false;
}
/**

Powered by Google App Engine
This is Rietveld 408576698