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

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

Issue 1001063002: Correctly compute whether a class subclasses Function (issue 22805) (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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/generated/error_verifier.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/element.dart
diff --git a/pkg/analyzer/lib/src/generated/element.dart b/pkg/analyzer/lib/src/generated/element.dart
index d8061b90a054ab5e96ce73cdaaefb9ac303ab608..7217ff51888372ee8274b5d0bea02c6d97c14362 100644
--- a/pkg/analyzer/lib/src/generated/element.dart
+++ b/pkg/analyzer/lib/src/generated/element.dart
@@ -3301,8 +3301,8 @@ abstract class ExecutableElementImpl extends ElementImpl
/**
* An empty list of executable elements.
*/
- static const List<ExecutableElement> EMPTY_ARRAY = const <ExecutableElement>[
- ];
+ static const List<ExecutableElement> EMPTY_ARRAY =
+ const <ExecutableElement>[];
/**
* A list containing all of the functions defined within this executable
@@ -5358,8 +5358,8 @@ abstract class HtmlScriptElementImpl extends ElementImpl
/**
* An empty list of HTML script elements.
*/
- static const List<HtmlScriptElement> EMPTY_ARRAY = const <HtmlScriptElement>[
- ];
+ static const List<HtmlScriptElement> EMPTY_ARRAY =
+ const <HtmlScriptElement>[];
/**
* Initialize a newly created script element corresponding to the given
@@ -6487,7 +6487,7 @@ class InterfaceTypeImpl extends TypeImpl implements InterfaceType {
}
}
return true;
- } else if (typeS.isDartCoreFunction && elementT.getMethod("call") != null) {
+ } else if (typeS.isDartCoreFunction && _hasCallMethod(elementT)) {
return true;
}
InterfaceType supertype = superclass;
@@ -6515,6 +6515,15 @@ class InterfaceTypeImpl extends TypeImpl implements InterfaceType {
}
/**
+ * Return `true` if the given element has an instance method named 'call'.
+ */
+ bool _hasCallMethod(ClassElement elementT) {
+ MethodElement method = elementT.lookUpMethod(
+ FunctionElement.CALL_METHOD_NAME, elementT.library);
+ return method != null && !method.isStatic;
+ }
+
+ /**
* Return the length of the longest inheritance path from the given [type] to
* Object.
*
@@ -9690,8 +9699,8 @@ class TypeParameterTypeImpl extends TypeImpl implements TypeParameterType {
/**
* An empty list of type parameter types.
*/
- static const List<TypeParameterType> EMPTY_ARRAY = const <TypeParameterType>[
- ];
+ static const List<TypeParameterType> EMPTY_ARRAY =
+ const <TypeParameterType>[];
/**
* Initialize a newly created type parameter type to be declared by the given
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/error_verifier.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698