microsoft / microsoft/TypeScript
Return statement in iterator is not type checked
オープン
@rbuckton がすでに取り組んでいます。
2019年3月4日 から。
Needs Investigation
- 主要言語
- Go
- スター
- 111k
- フォーク
- 14.4k
- 平均マージ
- 1日 19時間
- マージ済み PR(30日)
- 117
説明
TypeScript Version: 5.3.2.
Search Terms: yield, return, iterator.
Code:
interface Result {
foo: number;
}
function* gen(): IterableIterator<Result> {
yield { foo: 1 };
return { garbage: true }; // not checked
}
(function go(iterator) {
const { value, done } = iterator.next();
console.log(value);
if (!done) {
go(iterator);
}
})(gen());
Expected behavior: type error on return statement.
Actual behavior: no type errors.
Related Issues: https://github.com/Microsoft/TypeScript/issues/26959.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
評価
この issue はまだ評価されていません。