basedmypy icon indicating copy to clipboard operation
basedmypy copied to clipboard

generic bounds don't work with a generic tuple

Open DetachHead opened this issue 2 years ago • 0 comments

from typing import Generic, TypeVar
from basedtyping import T

class Foo(Generic[T]): ...

U = TypeVar("U", bound=Foo[T])

class G(Generic[T]): ...

class C(G[tuple[U, T]]): ...

# error: Value of type variable "U" of "C" cannot be "int"
reveal_type(C[Foo[int], int])

DetachHead avatar Oct 31 '23 05:10 DetachHead