No report of implicit any type in a generator when destructuring

オープン
#43,172 コメント 5 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
typescript
領域
compilers

調査の方向性

リンクされている TypeScript Playground の例から始め、checker がジェネレーターの yield からの分割代入に対する implicit-any 診断をどのように処理するかを追跡してください。例が分割代入された両方の変数 b と c についてエラーを報告し、a に対する既存の診断を維持できれば完了です。

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

説明

Bug Domain: check: Type Inference Help Wanted

Bug Report

🔎 Search Terms

no implicit any, generator, yield, destructure
#41348 - Report implicit any error for 'yield' result with no contextual type

🕗 Version & Regression Information

TypeScript 4.2.3

⏯ Playground Link

Playground link with relevant code

💻 Code
function* sample() {
    const a = yield 1 // error, as expected, a is implicitly any
    const { b } = yield 1 // no error, but expected, b is implicitly any
    const [c] = yield 1 // no error, but expected, c is implicitly any
}
🙁 Actual behavior

b, c implicitly have type any, but no error reported

🙂 Expected behavior

Errors reported

主要言語
Go
スター
111k
フォーク
14.4k
平均マージ
1日 19時間
マージ済み PR(30日)
117

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

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

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

microsoft/TypeScript のほかの issue

microsoft/TypeScript の issue をすべて見る

似ている issue

Go の issue をもっと見る

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

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