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

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

Issue 2366963002: Issue 27300. Report HintCode.ABSTRACT_SUPER_MEMBER_REFERENCE. (Land again) (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
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 37120461b8efef10d0faf164384c8e8105884641..4118d8d5d360f48760e75d9957260cc3f6a7c576 100644
--- a/pkg/analyzer/lib/src/dart/element/element.dart
+++ b/pkg/analyzer/lib/src/dart/element/element.dart
@@ -699,6 +699,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 | « pkg/analysis_server/test/integration/analysis/error_test.dart ('k') | pkg/analyzer/lib/src/error/codes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698