ruby / ruby/rbs

Inconsistencies when yielding multiple values

Open
#734 3 comments 0 reactions 1 assignee View on GitHub

@soutaro is already working on this.

Since Aug 13, 2021.

steep
Dominant language
Ruby
Stars
2.2k
Forks
256
Avg merge
6d 17h
Merged PRs (30d)
37

Description

Coming from https://github.com/ruby/rbs/pull/733 , I also noticed an inconsistent behaviour, which generates steep errors, but it's probably due to RBS definitions.

Array#each and other yielders, yield the Elem to the block. However, these elements can be "spread", for example when having arrays of tuples:

[[1, 2], [2, 3]].each do |left, right|
# ...

This particular issue has been addressed by my fix for Hash, but can't really work for the "array of arrays" case. But probably my fix should be reverted, and instead, support for tuple yielding should be addd instead. WDYT?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.