Skip to content

New analyzer: Ensure that mangled -redefinition names don't appear in error messages #6978

Open
@ilevkivskyi

Description

@ilevkivskyi

For example:

class A:
    x: str
    def x(self) -> str: ...

class B:
    x: int
    def x(self) -> int: ...

class C(A, B): ...

fails with

main:3: error: Name 'x' already defined on line 2
main:7: error: Name 'x' already defined on line 6
main:9: error: Definition of "x-redefinition" in base class "A" is incompatible with definition in base class "B"
main:9: error: Definition of "x" in base class "A" is incompatible with definition in base class "B"

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions