Chromium Code Reviews| Index: pkg/analyzer/lib/src/generated/type_system.dart |
| diff --git a/pkg/analyzer/lib/src/generated/type_system.dart b/pkg/analyzer/lib/src/generated/type_system.dart |
| index 6fcb63b250af71a920bee403b6a0c2075905a09f..c32e5c52b17a6949931542e34b0127b5702b816d 100644 |
| --- a/pkg/analyzer/lib/src/generated/type_system.dart |
| +++ b/pkg/analyzer/lib/src/generated/type_system.dart |
| @@ -354,8 +354,7 @@ class StrongTypeSystemImpl extends TypeSystem { |
| // Don't allow implicit downcasts between function types |
| // and call method objects, as these will almost always fail. |
| - if ((fromType is FunctionType && getCallMethodType(toType) != null) || |
| - (toType is FunctionType && getCallMethodType(fromType) != null)) { |
|
vsm
2016/08/12 20:47:00
Hmm, this feels odd to remove - doesn't this allow
Jennifer Messerly
2016/08/12 21:00:28
I was following instructions from TODO(vsm) here:
vsm
2016/08/12 21:10:44
I get it now. We're guaranteed to return false la
|
| + if (fromType is FunctionType && getCallMethodType(toType) != null) { |
| return false; |
| } |
| @@ -373,7 +372,7 @@ class StrongTypeSystemImpl extends TypeSystem { |
| // If the subtype relation goes the other way, allow the implicit |
| // downcast. |
| - if (isSubtypeOf(toType, fromType) || toType.isAssignableTo(fromType)) { |
| + if (isSubtypeOf(toType, fromType)) { |
| // TODO(leafp,jmesserly): we emit warnings/hints for these in |
| // src/task/strong/checker.dart, which is a bit inconsistent. That |
| // code should be handled into places that use isAssignableTo, such as |