Using a type alias with arguments in `case` block in a `match` statement gets the wrong error message with `parameters` instead of `arguments`
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 20.6k
- Forks
- 3.3k
- PR merge metrics
- PR metrics pending
Description
*Memo:
- mypy test.py
- mypy 1.19.1
- Python 3.14
- Windows 11
Using a type alias with arguments in case block in a match statement gets the wrong error message with parameters instead of arguments as shown below:
class Cls:
def __init__(self, x: int, y: int):
self.x = x
self.y = y
type TA = Cls
match Cls(x=10, y=20):
case TA(x=10, y=20):
print("OK")
error: Class pattern class must not be a type alias with type parameters
So, the error message should be with arguments instead of parameters as shown below:
error: Class pattern class must not be a type alias with type arguments
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
Start by reproducing the report with mypy test.py using mypy 1.19.1 and Python 3.14, then locate the diagnostic for a type alias used in a class pattern. Update the wording from “type parameters” to “type arguments” and verify that the example reports the corrected message.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100