Project

General

Profile

Backport #9298

Backport r44420: unknown keyword error with unnamed rest keywords argument

Added by nobu (Nobuyoshi Nakada) over 5 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal

Description

The following code should not raise "unknown keyword" error.

  def f10(a: 1, **)
    a
  end

  f10(b: 42)

Associated revisions

Revision be2101a6
Added by naruse (Yui NARUSE) over 5 years ago

merge revision(s) 44412,44413,44414,44420,44421: [Backport #9298]

    test_method.rb, test_proc.rb: suppress warnings

    * test/ruby/test_method.rb: suppress warnings in verbose mode.

    * test/ruby/test_proc.rb: ditto.
    * proc.c (rb_iseq_min_max_arity): maximum argument is unlimited if
      having rest keywords argument.  [ruby-core:53298] [Bug #8072]

    * iseq.c (rb_iseq_parameters): push argument type symbol only for
      unnamed rest keywords argument.

    * compile.c (iseq_set_arguments): set arg_keyword_check from
      nd_cflag, which is set by parser.  internal ID is used for
      unnamed keyword rest argument, which should be separated from no
      keyword check.

    * iseq.c (rb_iseq_parameters): if no keyword check, keyword rest is
      present.

    * parse.y (new_args_tail_gen): set keywords check to nd_cflag, which
      equals to that keyword rest is not present.

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

Revision 45138
Added by naruse (Yui NARUSE) over 5 years ago

merge revision(s) 44412,44413,44414,44420,44421: [Backport #9298]

test_method.rb, test_proc.rb: suppress warnings

* test/ruby/test_method.rb: suppress warnings in verbose mode.

* test/ruby/test_proc.rb: ditto.
* proc.c (rb_iseq_min_max_arity): maximum argument is unlimited if
  having rest keywords argument.  [ruby-core:53298] [Bug #8072]

* iseq.c (rb_iseq_parameters): push argument type symbol only for
  unnamed rest keywords argument.

* compile.c (iseq_set_arguments): set arg_keyword_check from
  nd_cflag, which is set by parser.  internal ID is used for
  unnamed keyword rest argument, which should be separated from no
  keyword check.

* iseq.c (rb_iseq_parameters): if no keyword check, keyword rest is
  present.

* parse.y (new_args_tail_gen): set keywords check to nd_cflag, which
  equals to that keyword rest is not present.

History

#1

Updated by nobu (Nobuyoshi Nakada) over 5 years ago

  • Description updated (diff)
#2

Updated by nobu (Nobuyoshi Nakada) over 5 years ago

2.0.0 also needs it.

#3

Updated by nobu (Nobuyoshi Nakada) over 5 years ago

r44421 fixes a build error by clang.

#4

Updated by naruse (Yui NARUSE) over 5 years ago

This conflicts with current ruby_2_1

Updated by naruse (Yui NARUSE) over 5 years ago

  • Status changed from Assigned to Feedback

Updated by nobu (Nobuyoshi Nakada) over 5 years ago

  • Description updated (diff)

Updated by naruse (Yui NARUSE) over 5 years ago

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

Applied in changeset r45138.


merge revision(s) 44412,44413,44414,44420,44421: [Backport #9298]

test_method.rb, test_proc.rb: suppress warnings

* test/ruby/test_method.rb: suppress warnings in verbose mode.

* test/ruby/test_proc.rb: ditto.
* proc.c (rb_iseq_min_max_arity): maximum argument is unlimited if
  having rest keywords argument.  [ruby-core:53298] [Bug #8072]

* iseq.c (rb_iseq_parameters): push argument type symbol only for
  unnamed rest keywords argument.

* compile.c (iseq_set_arguments): set arg_keyword_check from
  nd_cflag, which is set by parser.  internal ID is used for
  unnamed keyword rest argument, which should be separated from no
  keyword check.

* iseq.c (rb_iseq_parameters): if no keyword check, keyword rest is
  present.

* parse.y (new_args_tail_gen): set keywords check to nd_cflag, which
  equals to that keyword rest is not present.

Also available in: Atom PDF