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 5574aed89f2b09b3e9abf83af23f13bfb8b2f982..27a61642d23e6257d0d2875222263b4552c4564e 100644 |
--- a/pkg/analyzer/lib/src/generated/type_system.dart |
+++ b/pkg/analyzer/lib/src/generated/type_system.dart |
@@ -851,7 +851,7 @@ class StrongTypeSystemImpl extends TypeSystem { |
if (identical(i1, i2)) { |
return true; |
} |
- |
+ |
// Guard recursive calls |
_GuardedSubtypeChecker<InterfaceType> guardedInterfaceSubtype = _guard( |
(DartType i1, DartType i2, Set<Element> visited) => |
@@ -1143,6 +1143,21 @@ abstract class TypeSystem { |
DartType instantiateToBounds(DartType type); |
/** |
+ * Instantiate a parameterized type using `dynamic` for all generic |
+ * parameters. Returns the type unchanged if there are no parameters. |
+ */ |
+ DartType instantiateToDynamic(DartType type) { |
+ List<DartType> typeFormals = typeFormalsAsTypes(type); |
+ int count = typeFormals.length; |
+ if (count > 0) { |
+ List<DartType> typeArguments = |
+ new List<DartType>.filled(count, DynamicTypeImpl.instance); |
+ return instantiateType(type, typeArguments); |
+ } |
+ return type; |
+ } |
+ |
+ /** |
* Given a [DartType] [type] and a list of types |
* [typeArguments], instantiate the type formals with the |
* provided actuals. If [type] is not a parameterized type, |
@@ -1439,14 +1454,7 @@ class TypeSystemImpl extends TypeSystem { |
* parameters. Returns the type unchanged if there are no parameters. |
*/ |
DartType instantiateToBounds(DartType type) { |
- List<DartType> typeFormals = typeFormalsAsTypes(type); |
- int count = typeFormals.length; |
- if (count > 0) { |
- List<DartType> typeArguments = |
- new List<DartType>.filled(count, DynamicTypeImpl.instance); |
- return instantiateType(type, typeArguments); |
- } |
- return type; |
+ return instantiateToDynamic(type); |
} |
@override |