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