Using a type alias with arguments in `case` block in a `match` statement gets the wrong error message with `parameters` instead of `arguments`
オープン
まだ誰も着手していません。
bug
topic-match-statement
- 主要言語
- Python
- スター
- 20.6k
- フォーク
- 3.3k
- PR マージ指標
- PR 指標を取得中
説明
*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
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、mypy 1.19.1 と Python 3.14 を使って mypy test.py で報告を再現し、次にクラスパターンで使用されている型エイリアスに対する診断を特定します。“type parameters” から “type arguments” へ文言を更新し、例で修正後のメッセージが報告されることを確認します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- compilers
- issue の種類
- バグ
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 活発さ
- 停滞
- 明瞭さ
- 明確に書かれている
- 初心者へのやさしさ
- 55/100