Special handling for Array#zip
オープン
まだ誰も着手していません。
- 主要言語
- Ruby
- スター
- 833
- フォーク
- 99
- 平均マージ
- 9時間 30分
- マージ済み PR(30日)
- 12
説明
It is useful to keep the elements of Array#zip as tuples. RBS of Array#zip has less information for the behavior, so it would be good to implement it as a built-in method.
as = [1, 2, 3]
bs = %w(a b c)
p as.zip(bs)
#=> expected: Array[[Integer, String]] (or [Integer, String?])
# actual: Array[Array[(Integer | String)?]]
as.zip(bs) do |a, b|
p a #=> expected: Integer
# actual: (Integer | String)?
p b #=> expected: String (or String?)
# actual: (Integer | String)?
end
cs = [1.0, 2.0, 3.0]
as.zip(bs, cs) do |a, b, c|
p a #=> expected: Integer
# actual: untyped
p b #=> expected: String (or String?)
# actual: untyped
p c #=> expected: Float (or Float?)
# actual: untyped
end
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
issue ではファイルもテストも指定されていません。まず Array#zip の組み込み処理を探し、次に示されている配列とブロックの例を使ってタプル要素の型を確認し、結果として推論される型が期待される出力と一致することを確認してください。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- ruby
- 領域
- devtools
- issue の種類
- 機能追加
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 38/100