Created
April 29, 2016 19:45
-
-
Save gkellogg/5eb45b551d2662c6e78af9d20c5ad99a to your computer and use it in GitHub Desktop.
Rubinius splat with **options bug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Outer | |
def initialize(*args, **options) | |
raise ArgumentError, "args should be an array of a String, was #{args.inspect}" if args.first.is_a?(Array) | |
end | |
end | |
class Inner < Outer | |
def initialize(*args, **options) | |
super | |
end | |
end | |
Inner.new("foo", bar: :baz) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ rbx rbx-bug.rb | |
An exception occurred running rbx-bug.rb | |
args should be an array of a String, was [["foo"], "foo"] (ArgumentError) | |
Backtrace: | |
Outer(Inner)#initialize at rbx-bug.rb:3 | |
Inner#initialize at rbx-bug.rb:9 | |
Object#__script__ at rbx-bug.rb:13 | |
Rubinius::CodeLoader#load_script at kernel/delta/code_loader.rb:66 | |
Rubinius::CodeLoader.load_script at kernel/delta/code_loader.rb:152 | |
Rubinius::Loader#script at kernel/loader.rb:656 | |
Rubinius::Loader#main at kernel/loader.rb:842 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment