Project

General

Profile

Bug #10659

can't dup Fixnum (TypeError)

Added by janko (Janko Marohnić) almost 5 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
ruby -v:
ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-darwin14]
[ruby-core:67157]

Description

In Ruby 2.2 (older versions are good) there is a bug with unnamed keyword arguments when super is used.

module Foo
  def foo(**)
  end
end

class Bar
  include Foo

  def foo(bar: "bar", **)
    super
  end
end

Bar.new.foo # `dup': can't dup Fixnum (TypeError)

It happens when super is called. If I give the keyword arguments a name (** => **options) or if I remove the default keyword argument (bar: "bar"), the error doesn't happen.

Associated revisions

Revision 952ed33b
Added by nobu (Nobuyoshi Nakada) almost 5 years ago

parse.y: fix internal IDs conflict

  • parse.y (f_kwrest, new_args_tail_gen): unnamed rest keyword and keywords bits arguments should be unique. since internal IDs depend on the local variable index in the current scope, new ID should be made before popping those vtables. [ruby-core:67157] [Bug #10659]

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

Revision 49041
Added by nobu (Nobuyoshi Nakada) almost 5 years ago

parse.y: fix internal IDs conflict

  • parse.y (f_kwrest, new_args_tail_gen): unnamed rest keyword and keywords bits arguments should be unique. since internal IDs depend on the local variable index in the current scope, new ID should be made before popping those vtables. [ruby-core:67157] [Bug #10659]

Revision 49041
Added by nobu (Nobuyoshi Nakada) almost 5 years ago

parse.y: fix internal IDs conflict

  • parse.y (f_kwrest, new_args_tail_gen): unnamed rest keyword and keywords bits arguments should be unique. since internal IDs depend on the local variable index in the current scope, new ID should be made before popping those vtables. [ruby-core:67157] [Bug #10659]

Revision 49041
Added by nobu (Nobuyoshi Nakada) almost 5 years ago

parse.y: fix internal IDs conflict

  • parse.y (f_kwrest, new_args_tail_gen): unnamed rest keyword and keywords bits arguments should be unique. since internal IDs depend on the local variable index in the current scope, new ID should be made before popping those vtables. [ruby-core:67157] [Bug #10659]

Revision 49041
Added by nobu (Nobuyoshi Nakada) almost 5 years ago

parse.y: fix internal IDs conflict

  • parse.y (f_kwrest, new_args_tail_gen): unnamed rest keyword and keywords bits arguments should be unique. since internal IDs depend on the local variable index in the current scope, new ID should be made before popping those vtables. [ruby-core:67157] [Bug #10659]

Revision 49041
Added by nobu (Nobuyoshi Nakada) almost 5 years ago

parse.y: fix internal IDs conflict

  • parse.y (f_kwrest, new_args_tail_gen): unnamed rest keyword and keywords bits arguments should be unique. since internal IDs depend on the local variable index in the current scope, new ID should be made before popping those vtables. [ruby-core:67157] [Bug #10659]

Revision c7cb2128
Added by naruse (Yui NARUSE) almost 5 years ago

merge revision(s) 49041: [Backport #10659]

    * parse.y (f_kwrest, new_args_tail_gen): unnamed rest keyword and
      keywords bits arguments should be unique.  since internal IDs
      depend on the local variable index in the current scope, new ID
      should be made before popping those vtables.
      [ruby-core:67157] [Bug #10659]

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

Revision 49081
Added by naruse (Yui NARUSE) almost 5 years ago

merge revision(s) 49041: [Backport #10659]

* parse.y (f_kwrest, new_args_tail_gen): unnamed rest keyword and
  keywords bits arguments should be unique.  since internal IDs
  depend on the local variable index in the current scope, new ID
  should be made before popping those vtables.
  [ruby-core:67157] [Bug #10659]

History

Updated by nobu (Nobuyoshi Nakada) almost 5 years ago

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

Applied in changeset r49041.


parse.y: fix internal IDs conflict

  • parse.y (f_kwrest, new_args_tail_gen): unnamed rest keyword and keywords bits arguments should be unique. since internal IDs depend on the local variable index in the current scope, new ID should be made before popping those vtables. [ruby-core:67157] [Bug #10659]

Updated by usa (Usaku NAKAMURA) almost 5 years ago

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

Updated by naruse (Yui NARUSE) almost 5 years ago

  • Backport changed from 2.0.0: DONTNEED, 2.1: DONTNEED, 2.2: REQUIRED to 2.0.0: DONTNEED, 2.1: DONTNEED, 2.2: DONE

ruby_2_2 r49081 merged revision(s) 49041.

Also available in: Atom PDF