Actions
Bug #11068
closedunable to ommit an optional keyarg if the previous arg is an optional hash
Bug #11068:
unable to ommit an optional keyarg if the previous arg is an optional hash
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux]
Description
Updated by jeremyevans0 (Jeremy Evans) almost 7 years ago
- Related to Feature #14183: "Real" keyword argument added
Updated by jeremyevans0 (Jeremy Evans) almost 7 years ago
- Status changed from Open to Closed
With the acceptance of #14183, this code now emits warnings as the behavior will change in Ruby 3:
foo({b: 1})
# (irb):53: warning: The last argument is used as the keyword parameter
# (irb):51: warning: for `foo' defined here
# ArgumentError (unknown keyword: :b)
In Ruby 3, you will not get a warning, and the code will work as expected. To get the Ruby 3 behavior currently, you can do:
Actions