angular / angular/components

MatDialog `open` method `R` generic is too loose

オープン
#12,898 コメント 6 件 リアクション 3 件 担当者 0 名 GitHub で見る
area: material/dialog P4 refactoring
主要言語
TypeScript
スター
25k
フォーク
6.8k
平均マージ
1日 8時間
マージ済み PR(30日)
91

説明

Because the `R` generic on `MatDialog.open` isn't constrained by arguments to the function, it's effectively always `any`. We should remove the method generic and change the return generic to `{}`, which will force people to explicitly state which type it is when consuming it.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

まず MatDialog.open メソッドの宣言を見つけ、ジェネリック R がどのように定義され、返されるかを確認します。説明されているとおりにジェネリック型を更新し、その後、ダイアログ結果の利用側が意図した型を明示的に指定する必要があること、および既存の TypeScript チェックが引き続き通過することを確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
angular, typescript
領域
frontend
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。