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

Unified Diff: pkg/analyzer/lib/src/dart/element/element.dart

Issue 2364733002: Issue 27300. Report HintCode.ABSTRACT_SUPER_MEMBER_REFERENCE. (Closed)
Patch Set: Fixes for false positives. 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/lib/src/error/codes.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/dart/element/element.dart
diff --git a/pkg/analyzer/lib/src/dart/element/element.dart b/pkg/analyzer/lib/src/dart/element/element.dart
index 5d70df8c45ec1ec15a4f8384af627469031b6858..7e6adf9b54fcbd27f0ef4a78cde8625e4c9c4d9b 100644
--- a/pkg/analyzer/lib/src/dart/element/element.dart
+++ b/pkg/analyzer/lib/src/dart/element/element.dart
@@ -700,6 +700,18 @@ class ClassElementImpl extends AbstractClassElementImpl
return false;
}
+ /**
+ * Return `true` if the class has a `noSuchMethod()` method distinct from the
+ * one declared in class `Object`, as per the Dart Language Specification
+ * (section 10.4).
+ */
+ bool get hasNoSuchMethod {
+ MethodElement method =
+ lookUpMethod(FunctionElement.NO_SUCH_METHOD_METHOD_NAME, library);
+ ClassElement definingClass = method?.enclosingElement;
+ return definingClass != null && !definingClass.type.isObject;
+ }
+
@override
bool get hasReferenceToSuper => hasModifier(Modifier.REFERENCES_SUPER);
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/error/codes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698