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); |