Closed
Description
Bug Report
Regression added with #12590. Currently also part of the v0.950 release branch.
/CC: @JukkaL
To Reproduce
from dataclasses import dataclass
from typing import Any, Callable, Generic, TypeVar
T = TypeVar("T")
@dataclass
class Parent(Generic[T]):
f: Callable[[T], Any]
@dataclass
class Child(Parent[T]): ...
class A: ...
def func(obj: A) -> bool: ...
reveal_type(Child[A](func).f)
Expected Behavior
test.py:18: note: Revealed type is "def (test.A) -> Any"
Actual Behavior
test.py:18: note: Revealed type is "def (T`1) -> Any"
test.py:18: error: Argument 1 to "Child" has incompatible type "Callable[[A], bool]"; expected "Callable[[T], Any]"
Your Environment
- Mypy version used: mypy 0.960+dev.50213b520b131fc1dd037dfcc1938beba1f4e177