Index: pkg/analyzer/test/generated/type_system_test.dart |
diff --git a/pkg/analyzer/test/generated/type_system_test.dart b/pkg/analyzer/test/generated/type_system_test.dart |
index 6aa2ad152ee9a8bd88438adcae751e4ab20ea842..c555954667b3ec7ee3b9b923ca644a86d0fba10e 100644 |
--- a/pkg/analyzer/test/generated/type_system_test.dart |
+++ b/pkg/analyzer/test/generated/type_system_test.dart |
@@ -1608,15 +1608,42 @@ class StrongSubtypingTest { |
DartType u = TypeBuilder.variable("U", bound: intType); |
DartType v = TypeBuilder.variable("V", bound: u); |
+ DartType a = TypeBuilder.variable("A"); |
+ DartType b = TypeBuilder.variable("B", bound: a); |
+ DartType c = TypeBuilder.variable("C", bound: intType); |
+ DartType d = TypeBuilder.variable("D", bound: c); |
+ |
_checkIsStrictSubtypeOf( |
TypeBuilder.function(types: [s, t], required: [s], result: t), |
+ TypeBuilder.function( |
+ types: [a, b], required: [dynamicType], result: dynamicType)); |
+ |
+ _checkIsNotSubtypeOf( |
+ TypeBuilder.function(types: [u, v], required: [u], result: v), |
+ TypeBuilder.function( |
+ types: [c, d], required: [objectType], result: objectType)); |
+ |
+ _checkIsNotSubtypeOf( |
+ TypeBuilder.function(types: [u, v], required: [u], result: v), |
+ TypeBuilder |
+ .function(types: [c, d], required: [intType], result: intType)); |
+ } |
+ |
+ void test_genericFunction_genericDoesNotSubtypeNonGeneric() { |
+ DartType s = TypeBuilder.variable("S"); |
+ DartType t = TypeBuilder.variable("T", bound: s); |
+ DartType u = TypeBuilder.variable("U", bound: intType); |
+ DartType v = TypeBuilder.variable("V", bound: u); |
+ |
+ _checkIsNotSubtypeOf( |
+ TypeBuilder.function(types: [s, t], required: [s], result: t), |
TypeBuilder.function(required: [dynamicType], result: dynamicType)); |
_checkIsNotSubtypeOf( |
TypeBuilder.function(types: [u, v], required: [u], result: v), |
TypeBuilder.function(required: [objectType], result: objectType)); |
- _checkIsStrictSubtypeOf( |
+ _checkIsNotSubtypeOf( |
TypeBuilder.function(types: [u, v], required: [u], result: v), |
TypeBuilder.function(required: [intType], result: intType)); |
} |