Actions
Feature #19002
openExplicit splat for enumerator kwarg blocks
Feature #19002:
Explicit splat for enumerator kwarg blocks
Status:
Open
Assignee:
-
Target version:
-
Description
I'm renovating some 2.x-era code that relied heavily on autosplat for block kwargs. As we all know, this throws an ArgumentError in Ruby 3:
ary = [
{ foo: 42, bar: 101 },
{ foo: 99, bar: 123 }
]
ary.map { |foo:, bar:| foo+bar } #=> ArgumentError
The nicest solution I could find so far is
and then
and I present this as a feature suggestion.
Updated by inopinatus (Joshua GOODALL) almost 4 years ago
- Description updated (diff)
Updated by inopinatus (Joshua GOODALL) almost 4 years ago
- Description updated (diff)
Updated by inopinatus (Joshua GOODALL) almost 4 years ago
Actions