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

Unified Diff: sdk/lib/_internal/compiler/implementation/dart_types.dart

Issue 147743005: classes with call-methods were not recognized as Functions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Forgot to update analyzer2 status file. Created 6 years, 11 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 | sdk/lib/_internal/compiler/implementation/elements/elements.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/dart_types.dart
diff --git a/sdk/lib/_internal/compiler/implementation/dart_types.dart b/sdk/lib/_internal/compiler/implementation/dart_types.dart
index a61dac85ba9cb75a13d19484ff5b9490eb671f9f..b45c6429126d6e7470486b507a52ba33444bf0cd 100644
--- a/sdk/lib/_internal/compiler/implementation/dart_types.dart
+++ b/sdk/lib/_internal/compiler/implementation/dart_types.dart
@@ -1216,11 +1216,17 @@ class SubtypeVisitor extends MoreSpecificVisitor {
bool visitInterfaceType(InterfaceType t, DartType s) {
if (super.visitInterfaceType(t, s)) return true;
- lookupCall(type) => type.lookupMember(Compiler.CALL_OPERATOR_NAME);
+ InterfaceTypeMember lookupCall(type) =>
+ type.lookupMember(Compiler.CALL_OPERATOR_NAME);
+
+ bool hasCallMethod(type) {
+ InterfaceTypeMember member = lookupCall(type);
+ return member != null && member.element.isFunction();
+ }
if (s is InterfaceType &&
s.element == compiler.functionClass &&
- lookupCall(t) != null) {
+ hasCallMethod(t)) {
return true;
} else if (s is FunctionType) {
InterfaceTypeMember call = lookupCall(t);
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/elements/elements.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698