Allow comparing two tuples (T_1, T_2, ..., T_n) and (U_1, U_2, ..., U_n) if T_1 is a subtype of U_1 or vice versa, T_2 is a subtype of U_2 or vice versa, etc.
Current behavior
Comparison is disallowed, because the static types of the tuples are not subtypes of each other.
Proposed behavior
Comparison is allowed, because the element types are subtypes of each other
Reason
Two tuples are considered equal if their elements are the same, regardless of their static type. Therefore, it should be possible to compare the two tuples.
Related issues
This is the same as #199 but now for tuples
Allow comparing two tuples
(T_1, T_2, ..., T_n)
and(U_1, U_2, ..., U_n)
ifT_1
is a subtype ofU_1
or vice versa,T_2
is a subtype ofU_2
or vice versa, etc.Example PIE Code:
Current behavior Comparison is disallowed, because the static types of the tuples are not subtypes of each other. Proposed behavior Comparison is allowed, because the element types are subtypes of each other
Reason Two tuples are considered equal if their elements are the same, regardless of their static type. Therefore, it should be possible to compare the two tuples.
Related issues This is the same as #199 but now for tuples