1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Add NEWS entry for Bug to help adding ruby2_keywords in the missing places

This commit is contained in:
Benoit Daloze 2022-04-05 11:36:32 +02:00
parent 4f25207e72
commit d3f659d3f9
Notes: git 2022-04-05 18:42:22 +09:00

29
NEWS.md
View file

@ -59,6 +59,33 @@ Note that each entry is kept to a minimum, see links for details.
* Find pattern is no longer experimental.
[[Feature #18585]]
* Methods taking a rest parameter (like `*args`) and wishing to delegate keyword
arguments through `foo(*args)` must now be marked with `ruby2_keywords`
(if not already the case). In other words, all methods wishing to delegate
keyword arguments through `*args` must now be marked with `ruby2_keywords`,
with no exception. This will make it easier to transition to other ways of
delegation once a library can require Ruby 3+. Previously, the `ruby2_keywords`
flag was kept if the receiving method took `*args`, but this was a bug and an
inconsistency. [[Bug #18625]] [[Bug #16466]]
```ruby
def target(**kw)
end
# Accidentally worked without ruby2_keywords in Ruby 2.7-3.1, ruby2_keywords
# needed in 3.2+. Just like (*args, **kwargs) or (...) would be needed on
# both #foo and #bar when migrating away from ruby2_keywords.
ruby2_keywords def bar(*args)
target(*args)
end
ruby2_keywords def foo(*args)
bar(*args)
end
foo(k: 1)
```
## Command line options
## Core classes updates
@ -203,6 +230,7 @@ The following deprecated APIs are removed.
[Feature #15357]: https://bugs.ruby-lang.org/issues/15357
[Bug #15928]: https://bugs.ruby-lang.org/issues/15928
[Feature #16131]: https://bugs.ruby-lang.org/issues/16131
[Bug #16466]: https://bugs.ruby-lang.org/issues/16466
[Feature #16806]: https://bugs.ruby-lang.org/issues/16806
[Bug #16889]: https://bugs.ruby-lang.org/issues/16889
[Bug #16908]: https://bugs.ruby-lang.org/issues/16908
@ -217,4 +245,5 @@ The following deprecated APIs are removed.
[Feature #18571]: https://bugs.ruby-lang.org/issues/18571
[Feature #18585]: https://bugs.ruby-lang.org/issues/18585
[Feature #18598]: https://bugs.ruby-lang.org/issues/18598
[Bug #18625]: https://bugs.ruby-lang.org/issues/18625
[Bug #18633]: https://bugs.ruby-lang.org/issues/18633