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

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

Issue 2361393002: Revert "Issue 27300. Report HintCode.ABSTRACT_SUPER_MEMBER_REFERENCE." (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 | « pkg/analyzer/lib/src/error/codes.dart ('k') | pkg/analyzer/lib/src/generated/resolver.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 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.
*/
« no previous file with comments | « pkg/analyzer/lib/src/error/codes.dart ('k') | pkg/analyzer/lib/src/generated/resolver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698