Incompatible type; expected "Optional[T]" with generic dataclasses inheritance #12167
Labels
bug
mypy got something wrong
topic-dataclasses
topic-inheritance
Inheritance and incompatible overrides
Please provide more information to help us understand the issue:
I believe this is a bug.
or a mock-up repro if the source is private. We would appreciate
if you try to simplify your case to a minimal repro.
Here is MRE:
error: Argument "attr" to "B" has incompatible type "int"; expected "Optional[T]"
The code should type check, as it does without dataclass
mypy 0.910
The defaults, executed with:
mypy test_script.py
The text was updated successfully, but these errors were encountered: