mypy icon indicating copy to clipboard operation
mypy copied to clipboard

The implementation of TypeChecker.fail is incorrect

Open delfick opened this issue 1 year ago • 0 comments

Hi, it appears that TypeChecker.fail doesn't match the CheckerPluginInterface interface

https://github.com/python/mypy/blob/d39f0234a18762a9b261a28763c7bea706633ce7/mypy/plugin.py#L242

    @abstractmethod
    def fail(
        self, msg: str | ErrorMessage, ctx: Context, *, code: ErrorCode | None = None
    ) -> None:

https://github.com/python/mypy/blob/d39f0234a18762a9b261a28763c7bea706633ce7/mypy/checker.py#L7184

    def fail(
        self, msg: str | ErrorMessage, context: Context, *, code: ErrorCode | None = None
    ) -> None:

For some reason the implementation names ctx as context.

delfick avatar Jun 26 '24 02:06 delfick