Adding the following test to ConstraintsSuite fails with assert set() == {1 <: B, 1 <: A}:
def test_wrapped_tuple_identical_results(self) -> None:
# test inferred constraints of tuple[T, ...] <: tuple[A, B]
# vs inferred constraints of tuple[*tuple[T, ...]] <: tuple[A, B]
fx = self.fx
t = Instance(fx.std_tuplei, [fx.t])
assert set(infer_constraints(
t,
TupleType([self.fx.a, self.fx.b], fallback=self.fx.std_tuple),
SUBTYPE_OF,
)) == set(infer_constraints(
TupleType([UnpackType(t)], fallback=self.fx.std_tuple),
TupleType([self.fx.a, self.fx.b], fallback=self.fx.std_tuple),
SUBTYPE_OF,
))
Adding the following test to
ConstraintsSuitefails withassert set() == {1 <: B, 1 <: A}: