Open
Description
Consider this .pyi
code snippet:
from typing import Any, Generic, Self, TypeVar, TypeVarTuple, type_check_only
T = TypeVar("T")
Ts = TypeVarTuple("Ts")
@type_check_only
class S(tuple[*Ts], Generic[T, *Ts]):
def f(self, x: T, /) -> T: ...
When ran through mypy
(checked with 1.15.0
and the master branch), the following error is reported
Argument 1 to "type_check_only" has incompatible type "type[S[T, *Ts]]"; expected "type[S[T, *Ts]]" [arg-type]
Without the additional T
type parameter, the false positive error disappears. It also disappears if I remove the tuple
baseclass.
And as far as I could tell, it doesn't seem to be associated with a particular config option or cli flag.