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

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

Issue 2594873002: Make call methods definite. (Closed)
Patch Set: Rebase Created 3 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 | pkg/analyzer/lib/src/task/strong/checker.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 35d04c1360b79d8aec5707fd5da073cd576a4dae..ed117afc63938a632ccaf1cd4f18d1bdd1d801e2 100644
--- a/pkg/analyzer/lib/src/generated/type_system.dart
+++ b/pkg/analyzer/lib/src/generated/type_system.dart
@@ -229,6 +229,17 @@ class StrongTypeSystemImpl extends TypeSystem {
/**
* Given a type t, if t is an interface type with a call method
+ * defined, return the definite function type for the call method,
+ * otherwise return null.
+ */
+ FunctionType getCallMethodDefiniteType(DartType t) {
+ var type = getCallMethodType(t);
+ if (type == null) return type;
+ return functionTypeToConcreteType(type);
+ }
+
+ /**
+ * Given a type t, if t is an interface type with a call method
* defined, return the function type for the call method, otherwise
* return null.
*/
@@ -956,7 +967,7 @@ class StrongTypeSystemImpl extends TypeSystem {
// the interface type declares a call method with a type
// which is a super type of the function type.
if (t1 is InterfaceType && t2 is FunctionType) {
- var callType = getCallMethodType(t1);
+ var callType = getCallMethodDefiniteType(t1);
return (callType != null) && _isFunctionSubtypeOf(callType, t2);
}
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/task/strong/checker.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698