Project

General

Profile

Bug #13793

Compatible issue with keyword args behavior

Added by hsbt (Hiroshi SHIBATA) about 2 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:82291]

Description

I found breaking changes for keyword args with Ruby 2.5.1

Reproduction instructions:

  • git clone git@github.com:bundler/bundler.git
  • gem i rspec
  • cd bundler && rspec spec/commands/viz_spec.rb:13

Ruby 2.4.1:

~/D/g/b/bundler (master) > rspec spec/commands/viz_spec.rb:13
Run options:
  include {:locations=>{"./spec/commands/viz_spec.rb"=>[13]}}
  exclude {:bundler=>"=< 1.15", :rubygems_master=>true, :git=>"=< 2.14.0", :rubygems=>"=< 2.6.11", :ruby=>"=< 2.4.1", :realworld=>true, :sudo=>true}

bundle viz
  graphs gems from the Gemfile


Retried examples: 0

Finished in 3.35 seconds (files took 1.37 seconds to load)
1 example, 0 failures

Ruby 2.5.0(ruby 2.5.0dev (2017-08-08 trunk 59529) [x86_64-darwin16])

~/D/g/b/bundler (master) > rspec spec/commands/viz_spec.rb:13
Run options:
  include {:locations=>{"./spec/commands/viz_spec.rb"=>[13]}}
  exclude {:bundler=>"=< 1.15", :rubygems_master=>true, :git=>"=< 2.14.0", :rubygems=>"=< 2.6.12", :ruby=>"=< 2.5.0", :realworld=>true, :sudo=>true}

bundle viz
(snip)
       ArgumentError: unknown keyword: png
         /path/to/bundler/bundler/tmp/gems/system/gems/ruby-graphviz-1.2.3/lib/graphviz.rb:441:in `output'
         /path/to/bundler/bundler/lib/bundler/graph.rb:142:in `run'
(snip)

I also reported bundler's tracker: https://github.com/bundler/bundler/issues/5939


Related issues

Related to Ruby master - Bug #13791: `belongs_to': unknown keywords: required, anonymous_class (ArgumentError) since Revision 59519ClosedActions
Related to Ruby master - Bug #10856: Splat with empty keyword args gives unexpected resultsClosedActions

Associated revisions

Revision 059cf260
Added by nobu (Nobuyoshi Nakada) about 2 years ago

compile.c: fix KW_SPLAT flag condition

  • compile.c (compile_array_keyword_arg): fix the condition of KW_SPLAT flag. splat is value node only without key node, simple assoc argument is not. [ruby-core:82291] [Bug #13793]

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

Revision 59556
Added by nobu (Nobuyoshi Nakada) about 2 years ago

compile.c: fix KW_SPLAT flag condition

  • compile.c (compile_array_keyword_arg): fix the condition of KW_SPLAT flag. splat is value node only without key node, simple assoc argument is not. [ruby-core:82291] [Bug #13793]

Revision 59556
Added by nobu (Nobuyoshi Nakada) about 2 years ago

compile.c: fix KW_SPLAT flag condition

  • compile.c (compile_array_keyword_arg): fix the condition of KW_SPLAT flag. splat is value node only without key node, simple assoc argument is not. [ruby-core:82291] [Bug #13793]

Revision 59556
Added by nobu (Nobuyoshi Nakada) about 2 years ago

compile.c: fix KW_SPLAT flag condition

  • compile.c (compile_array_keyword_arg): fix the condition of KW_SPLAT flag. splat is value node only without key node, simple assoc argument is not. [ruby-core:82291] [Bug #13793]

History

#1

Updated by nobu (Nobuyoshi Nakada) about 2 years ago

  • Is duplicate of Bug #13791: `belongs_to': unknown keywords: required, anonymous_class (ArgumentError) since Revision 59519 added
#2

Updated by nobu (Nobuyoshi Nakada) about 2 years ago

  • Is duplicate of deleted (Bug #13791: `belongs_to': unknown keywords: required, anonymous_class (ArgumentError) since Revision 59519)
#3

Updated by nobu (Nobuyoshi Nakada) about 2 years ago

  • Related to Bug #13791: `belongs_to': unknown keywords: required, anonymous_class (ArgumentError) since Revision 59519 added
#4

Updated by nobu (Nobuyoshi Nakada) about 2 years ago

  • Related to Bug #10856: Splat with empty keyword args gives unexpected results added

Updated by lugray (Lisa Ugray) about 2 years ago

Minimal example:

def test(options={})
  puts options
end
test **{foo: :bar}
#6

Updated by nobu (Nobuyoshi Nakada) about 2 years ago

  • Status changed from Open to Closed

Applied in changeset trunk|r59556.


compile.c: fix KW_SPLAT flag condition

  • compile.c (compile_array_keyword_arg): fix the condition of KW_SPLAT flag. splat is value node only without key node, simple assoc argument is not. [ruby-core:82291] [Bug #13793]

Also available in: Atom PDF