Skip to content

Commit a5830e2

Browse files
committed
Add one more test case for type unification
1 parent a56118f commit a5830e2

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

tests/test_type_utils.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1200,6 +1200,23 @@ def test_unify_types_function_type():
12001200
}
12011201

12021202

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+
12031220
def test_unify_types_with_simple_and_parameterized_types():
12041221
factory = kt.KotlinBuiltinFactory()
12051222
type_param1 = tp.TypeParameter("T1")
@@ -1222,7 +1239,6 @@ def test_unify_types_with_simple_and_parameterized_types():
12221239
[foo.new([kt.String, type_param2])])
12231240
bar_d = bar.new([kt.Long])
12241241
params = tutils.unify_types(bar_d, foo_d, factory, same_type=False)
1225-
print('ddd', params)
12261242
assert params == {type_param1: kt.Long}
12271243

12281244

0 commit comments

Comments
 (0)