Skip to content

show diff in signature #2154

@asukaminato0721

Description

@asukaminato0721

Describe the Bug

from abc import ABC
class A():
    def foo(self, a: int, b:int, c:int):
        raise NotImplementedError()

class B(A):
    def foo(self):
        x = 1
        print(x)
ERROR sandbox.py:15:9-12: Class member `B.foo` overrides parent class `A` in an inconsistent manner [[bad-override](https://pyrefly.org/en/docs/error-kinds/#bad-override)]
  `B.foo` has type `BoundMethod[B, (self: B) -> None]`, which is not assignable to `BoundMethod[B, (self: B, a: int, b: int, c: int) -> Never]`, the type of `A.foo`

I want the error message to be

def foo(self, a: int, b:int, c:int):
               ------------------
                              |
                               -----------------------these not match

Sandbox Link

No response

(Only applicable for extension issues) IDE Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions