Skip to content

Instantly share code, notes, and snippets.

@JEG2
Created July 29, 2013 19:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JEG2/6107233 to your computer and use it in GitHub Desktop.
Save JEG2/6107233 to your computer and use it in GitHub Desktop.
Uh, yuck.
class RequiredArgument
def initialize(one, keyword: false)
p [one, keyword]
end
end
RequiredArgument.new(Hash.new)
# ruby 2.0.0p195 (2013-05-14 revision 40734) [x86_64-darwin12.3.0]
# bug.rb:2:in `initialize': wrong number of arguments (0 for 1) (ArgumentError)
# from bug.rb:7:in `new'
# from bug.rb:7:in `<main>'
@pjg
Copy link

pjg commented Jul 29, 2013

In my Ruby (2.0.0-p247):

RequiredArgument.new(Hash.new)
=> [{}, false]

@JEG2
Copy link
Author

JEG2 commented Jul 29, 2013

It does seem to be fixed in p247. Thanks!

@stevenharman
Copy link

Confirmed @pjg's results on Ruby 2.0.0-p247.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment