Describe the Bug
In the following code example:
from typing import Any, Callable
class K[*Ts]:
func: Callable[[Any, *Ts], None]
def g[*Ts](x: int, *xs: *Ts):
K[*Ts]().func(x, *xs)
The call to func gets rejected because "Unpacked argument tuple[int, *Ts] is not assignable to varargs type tuple[Any, *Ts]". But it should be assignable, because Any is a gradual type. Even if it wasn't, tuples are also covariant.
Sandbox Link
https://pyrefly.org/sandbox/?project=v2.I7fIRGQn72itkOJYaMCA0q4VXFF0NFgPSB5YRAKTATgXglJHOliTRoUVMA6BhZlWBTCrAkVgyQ9ipoamHsg8jQqwAmCcYga5skIAREAB6npgYQOMq_RSYJEGjAO9mDxlYGmWqpBRUlJQbKWvD9OeX5Sun5qnn5KfXKyPokNfAZS6EssSM8E-QDVOIR-cRIqBxlIS1-qQqFbHF9PqoIgGqsAbeQA
(Only applicable for extension issues) IDE Information
No response
Describe the Bug
In the following code example:
The call to
funcgets rejected because "Unpacked argumenttuple[int, *Ts]is not assignable to varargs typetuple[Any, *Ts]". But it should be assignable, because Any is a gradual type. Even if it wasn't, tuples are also covariant.Sandbox Link
https://pyrefly.org/sandbox/?project=v2.I7fIRGQn72itkOJYaMCA0q4VXFF0NFgPSB5YRAKTATgXglJHOliTRoUVMA6BhZlWBTCrAkVgyQ9ipoamHsg8jQqwAmCcYga5skIAREAB6npgYQOMq_RSYJEGjAO9mDxlYGmWqpBRUlJQbKWvD9OeX5Sun5qnn5KfXKyPokNfAZS6EssSM8E-QDVOIR-cRIqBxlIS1-qQqFbHF9PqoIgGqsAbeQA
(Only applicable for extension issues) IDE Information
No response