Skip to content

Setting the same name parameters get the wrong error message saying argument instead of parameter #20936

@hyperkai

Description

@hyperkai

*Notes:

  • mypy test.py
  • mypy 1.19.1
  • Python 3.14.0

Setting the same name parameters get the wrong error message saying argument instead of parameter as shown below:

       # ↓       ↓
def func(x: int, x: str): ...
# Error

error: Duplicate argument "x" in function definition

So, the error message should say parameter as shown below:

error: Duplicate parameter "x" in function definition

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmypy got something wrong

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions