Project

General

Profile

Actions

Bug #10659

closed

can't dup Fixnum (TypeError)

Added by janko (Janko Marohnić) over 9 years ago. Updated over 9 years ago.

Status:
Closed
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.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0