Adding the following test to ConstraintsSuite fails with assert set() == {1 <: B, 1 <: A}:
deftest_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.fxt=Instance(fx.std_tuplei, [fx.t])
assertset(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}: