| 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 13964bab2dead6462c894514154993267ee22831..8d4786c76c2303091d911a225b37147d76818d55 100644
|
| --- a/pkg/analyzer/lib/src/generated/error_verifier.dart
|
| +++ b/pkg/analyzer/lib/src/generated/error_verifier.dart
|
| @@ -2656,7 +2656,7 @@ class ErrorVerifier extends RecursiveAstVisitor<Object> {
|
| overriddenMember = _enclosingClass.lookUpInheritedConcreteMethod(
|
| memberName, _currentLibrary);
|
| }
|
| - if (overriddenMember == null && !_enclosingClass.hasNoSuchMethod) {
|
| + if (overriddenMember == null && !_hasNoSuchMethod(_enclosingClass)) {
|
| _errorReporter.reportErrorForNode(
|
| StaticWarningCode.CONCRETE_CLASS_WITH_ABSTRACT_MEMBER,
|
| nameNode,
|
| @@ -4971,7 +4971,7 @@ class ErrorVerifier extends RecursiveAstVisitor<Object> {
|
| SimpleIdentifier classNameNode) {
|
| if (_enclosingClass.isAbstract) {
|
| return;
|
| - } else if (_enclosingClass.hasNoSuchMethod) {
|
| + } else if (_hasNoSuchMethod(_enclosingClass)) {
|
| return;
|
| }
|
| //
|
| @@ -6098,7 +6098,7 @@ class ErrorVerifier extends RecursiveAstVisitor<Object> {
|
| }
|
| // If there is a noSuchMethod method, then don't report the warning,
|
| // see dartbug.com/16078
|
| - if (_enclosingClass.hasNoSuchMethod) {
|
| + if (_hasNoSuchMethod(classElement)) {
|
| return;
|
| }
|
| ExecutableElement callMethod = _inheritanceManager.lookupMember(
|
| @@ -6395,6 +6395,22 @@ class ErrorVerifier extends RecursiveAstVisitor<Object> {
|
| }
|
|
|
| /**
|
| + * Return `true` if the given [classElement] has a noSuchMethod() method
|
| + * distinct from the one declared in class Object, as per the Dart Language
|
| + * Specification (section 10.4).
|
| + */
|
| + bool _hasNoSuchMethod(ClassElement classElement) {
|
| + MethodElement method = classElement.lookUpMethod(
|
| + FunctionElement.NO_SUCH_METHOD_METHOD_NAME, classElement.library);
|
| + if (method == null) {
|
| + return false;
|
| + }
|
| + ClassElement definingClass =
|
| + method.getAncestor((Element element) => element is ClassElement);
|
| + return definingClass != null && !definingClass.type.isObject;
|
| + }
|
| +
|
| + /**
|
| * Return `true` if the given [constructor] redirects to itself, directly or
|
| * indirectly.
|
| */
|
|
|