You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
It is useful to keep the elements of
Array#zip
as tuples. RBS ofArray#zip
has less information for the behavior, so it would be good to implement it as a built-in method.The text was updated successfully, but these errors were encountered: