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

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

Issue 2231273002: fix #26120, sideways casts no longer supported (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: fix Created 4 years, 4 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
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

Powered by Google App Engine
This is Rietveld 408576698