Skip to content

TypeVarTuple should accept compatible tuple types when solving #2372

Closed as duplicate

Description

@migeed-z

Describe the Bug

When a function uses the same TypeVarTuple for two parameters, pyrefly solves
from the first argument and rejects the second if it doesn't exactly match. It
should find a solution that satisfies both arguments. Since int <: float,
Ts should solve to (float,) and accept both.

  from typing import TypeVarTuple
  Ts = TypeVarTuple("Ts")
  def func2(arg1: tuple[*Ts], arg2: tuple[*Ts]) -> tuple[*Ts]: ...
  func2((0,), (0.0,))  # pyrefly rejects this, but should accept (int <: float)

Unittest:

pyrefly/lib/test/type_var_tuple.rs — test_typevartuple_compatible_tuple_types

Sandbox Link

No response

(Only applicable for extension issues) IDE Information

No response

Activity

  1. added this to the V1 Release milestone on Feb 9, 2026
  2. added theissue type on Feb 9, 2026
  3. added
    help wantedLarger than "good first issue", but still well-defined and ready for someone to pick up
    and removed
    help wantedLarger than "good first issue", but still well-defined and ready for someone to pick up
    on Feb 9, 2026
  4. yangdanny97 commented on Feb 9, 2026

    @yangdanny97
    Collaborator

    This is #105

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions