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

Unified Diff: pkg/analyzer/lib/src/generated/error_verifier.dart

Issue 2348383006: Fix mustCallSuper to ignore methods from interfaces (Closed)
Patch Set: Created 4 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 | pkg/analyzer/test/generated/hint_code_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/error_verifier.dart
diff --git a/pkg/analyzer/lib/src/generated/error_verifier.dart b/pkg/analyzer/lib/src/generated/error_verifier.dart
index 47a4979d56e5662fe2886d6bf6c088b20375fbc9..8d4786c76c2303091d911a225b37147d76818d55 100644
--- a/pkg/analyzer/lib/src/generated/error_verifier.dart
+++ b/pkg/analyzer/lib/src/generated/error_verifier.dart
@@ -6361,16 +6361,24 @@ class ErrorVerifier extends RecursiveAstVisitor<Object> {
}
ExecutableElement _getOverriddenMember(Element member) {
- if (member == null || _inheritanceManager == null) {
+ if (member == null) {
return null;
}
-
ClassElement classElement =
member.getAncestor((element) => element is ClassElement);
if (classElement == null) {
return null;
}
- return _inheritanceManager.lookupInheritance(classElement, member.name);
+ String name = member.name;
+ ClassElement superclass = classElement.supertype?.element;
+ while (superclass != null) {
+ ExecutableElement member = superclass.getMethod(name) ?? superclass.getGetter(name) ?? superclass.getSetter(name);
+ if (member != null) {
+ return member;
+ }
+ superclass = superclass.supertype?.element;
+ }
+ return null;
}
/**
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/hint_code_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698