Skip to content

Commit 829f127

Browse files
committed
Add the reproducer from the issue to the test
1 parent 3b04203 commit 829f127

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎Lib/test/test_type_params.py‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -933,6 +933,15 @@ class Foo[__T, __U: __T](make_base(__T), make_base(lambda: __T)):
933933
def test_later_type_params_are_mangled(self):
934934
# gh-162597: a bound, constraint or default that refers to a later
935935
# private type parameter.
936+
class C[T: __U, __U]:
937+
pass
938+
class D[__U, T: __U]:
939+
pass
940+
T, U = C.__type_params__
941+
self.assertIs(T.__bound__, U)
942+
U, T = D.__type_params__
943+
self.assertIs(T.__bound__, U)
944+
936945
ns = run_code("""
937946
__U = "global"
938947

0 commit comments

Comments
 (0)