@@ -1200,6 +1200,23 @@ def test_unify_types_function_type():
1200
1200
}
1201
1201
1202
1202
1203
+ def test_unify_types_same_parameterized_type ():
1204
+ factory = kt .KotlinBuiltinFactory ()
1205
+ type_param1 = tp .TypeParameter ("T1" )
1206
+ type_param2 = tp .TypeParameter ("T2" )
1207
+ type_param3 = tp .TypeParameter ("T3" )
1208
+ type_param4 = tp .TypeParameter ("T4" )
1209
+ foo = tp .TypeConstructor ("Foo" , [type_param1 , type_param2 ])
1210
+ foo_type = foo .new ([type_param3 , type_param4 ])
1211
+
1212
+ params = tutils .unify_types (foo_type , foo_type , factory )
1213
+
1214
+ assert params == {
1215
+ type_param3 : type_param3 ,
1216
+ type_param4 : type_param4
1217
+ }
1218
+
1219
+
1203
1220
def test_unify_types_with_simple_and_parameterized_types ():
1204
1221
factory = kt .KotlinBuiltinFactory ()
1205
1222
type_param1 = tp .TypeParameter ("T1" )
@@ -1222,7 +1239,6 @@ def test_unify_types_with_simple_and_parameterized_types():
1222
1239
[foo .new ([kt .String , type_param2 ])])
1223
1240
bar_d = bar .new ([kt .Long ])
1224
1241
params = tutils .unify_types (bar_d , foo_d , factory , same_type = False )
1225
- print ('ddd' , params )
1226
1242
assert params == {type_param1 : kt .Long }
1227
1243
1228
1244
0 commit comments