Closed
Description
Distilled from an issue in S:
from typing import Generic, List, Optional, TypeVar
Q = TypeVar("Q")
T = TypeVar("T", bound="RequestWrapper")
class RequestWrapper(Generic[Q]):
@classmethod
def valid(cls, reqs):
# type: (List[T]) -> List[T]
pass
class _ConcreteRequestWrapper(RequestWrapper[int]):
pass
def test(valid_reqs):
# type: (List[_ConcreteRequestWrapper]) -> None
_ConcreteRequestWrapper.valid(valid_reqs)
This produces an error in test
: error: Argument 1 to "valid" of "RequestWrapper" has incompatible type "List[_ConcreteRequestWrapper]"; expected "List[<nothing>]"
Looks like this was introduced in #7860.