Project

General

Profile

Bug #10699

m(*a, **b) doesn't recognize integer options.

Added by akr (Akira Tanaka) almost 5 years ago. Updated 3 months ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 2.3.0dev (2015-01-06 trunk 49159) [x86_64-linux]
[ruby-core:<unknown>]

Description

It seems a method defined as m(*a, **b) doesn't recognize integer options.

% ./ruby -v -e '
def m(*a, **b)
  p [a, b]
end
m(1, 2 => 3)
m(1, :foo => 3)
'
ruby 2.3.0dev (2015-01-06 trunk 49159) [x86_64-linux]
[[1, {2=>3}], {}]
[[1], {:foo=>3}]

I think the result should be follows.

[[1], {2=>3}]
[[1], {:foo=>3}]

I found this problem by https://github.com/ruby/ruby/pull/808


Related issues

Related to Ruby master - Feature #10118: Double splat for non-symbol keysClosedActions

Associated revisions

Revision 1ade9cad
Added by akr (Akira Tanaka) almost 5 years ago

  • lib/open3.rb: Open3 properly passes non-keyword hash args to spawn. Fixed by Josh Cheek. [Fix GH-808] Related to [ruby-core:67347] [Bug #10699]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49173 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 49173
Added by akr (Akira Tanaka) almost 5 years ago

  • lib/open3.rb: Open3 properly passes non-keyword hash args to spawn. Fixed by Josh Cheek. [Fix GH-808] Related to [ruby-core:67347] [Bug #10699]

Revision 49173
Added by akr (Akira Tanaka) almost 5 years ago

  • lib/open3.rb: Open3 properly passes non-keyword hash args to spawn. Fixed by Josh Cheek. [Fix GH-808] Related to [ruby-core:67347] [Bug #10699]

Revision 49173
Added by akr (Akira Tanaka) almost 5 years ago

  • lib/open3.rb: Open3 properly passes non-keyword hash args to spawn. Fixed by Josh Cheek. [Fix GH-808] Related to [ruby-core:67347] [Bug #10699]

Revision 49173
Added by akr (Akira Tanaka) almost 5 years ago

  • lib/open3.rb: Open3 properly passes non-keyword hash args to spawn. Fixed by Josh Cheek. [Fix GH-808] Related to [ruby-core:67347] [Bug #10699]

Revision 49173
Added by akr (Akira Tanaka) almost 5 years ago

  • lib/open3.rb: Open3 properly passes non-keyword hash args to spawn. Fixed by Josh Cheek. [Fix GH-808] Related to [ruby-core:67347] [Bug #10699]

History

Updated by sawa (Tsuyoshi Sawada) almost 5 years ago

I thought that was a feature. I proposed to extend the use of double splat, and a patch has already been provided by Nobu in #10118.

Updated by nobu (Nobuyoshi Nakada) almost 5 years ago

#10118 is only for splat, not rest keywords argument.

Updated by nobu (Nobuyoshi Nakada) almost 5 years ago

Updated by akr (Akira Tanaka) almost 5 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

Applied in changeset r49173.


  • lib/open3.rb: Open3 properly passes non-keyword hash args to spawn. Fixed by Josh Cheek. [Fix GH-808] Related to [ruby-core:67347] [Bug #10699]

Updated by akr (Akira Tanaka) almost 5 years ago

  • Status changed from Closed to Feedback

I didn't know this keyword arguments behavior.

Hm. I'm not sure the current behavior is good or not.

Anyway open3 has the problem since Ruby 2.1 and I don't expect Ruby 2.1 changes the keyword arguments behavior.
So I committed r49173 to fix open3 and it should be backportable.

Updated by nagachika (Tomoyuki Chikanaga) almost 5 years ago

  • Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN to 2.0.0: UNKNOWN, 2.1: REQUIRED, 2.2: UNKNOWN

Thank you akr san for your consideration about backports.
I'll fill Backport field with 2.1: REQUIRED only for r49173.

#8

Updated by jeremyevans0 (Jeremy Evans) 3 months ago

  • Status changed from Feedback to Closed

Also available in: Atom PDF