Inconsistencies when yielding multiple values
Open
@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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.