-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
bugmypy got something wrongmypy got something wrong
Description
Bug Report
If a decorator fails to apply, then the error gets noted as the start of the decorator chain.
I expected to find an issue already made about this, but I found nothing. I would not be surprised if this is a duplicate though.
To Reproduce
from collections.abc import Callable
def faulty(c: Callable[[int], None]) -> Callable[[tuple[int, int]], None]:
return lambda x: None
@faulty # 2 errors reported here
@faulty
def f(x: str) -> None:
return None
Interestingly, if faulty
returns Callable[[str], None]
this only reports 1 error. I assume this is an artifact of error deduplication.
Expected Behavior
Different line numbers.
Actual Behavior
Same line numbers.
Your Environment
Checked on mypy playground.
- Mypy version used: v1.14
- Mypy command-line flags: strict
- Mypy configuration options from
mypy.ini
(and other config files): N/A - Python version used: 3.12
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrong