New analyzer: Ensure that mangled -redefinition names don't appear in error messages
Open
Nobody has claimed this yet.
priority-1-normal
semantic-analyzer
topic-usability
- Dominant language
- Python
- Stars
- 20.6k
- Forks
- 3.3k
- PR merge metrics
- PR metrics pending
Description
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"
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the Python example from the issue with mypy and trace the analyzer path that formats the base-class incompatibility diagnostics. Done means the errors no longer expose the mangled "-redefinition" name while still reporting the relevant incompatibility.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100