Skip to content

Instantly share code, notes, and snippets.

@DNNX
Created December 14, 2012 07:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DNNX/4283465 to your computer and use it in GitHub Desktop.
Save DNNX/4283465 to your computer and use it in GitHub Desktop.
Different behaviour of default initializer in Ruby 1.9.2 and Ruby 1.9.3
➜ ~ rvm use 1.9.2 && ruby -e 'class A; end; puts A.new(1)'
Using /Users/user/.rvm/gems/ruby-1.9.2-p320
#<A:0x007fcdc204fac8>
➜ ~ rvm use 1.9.3 && ruby -e 'class A; end; puts A.new(1)'
Using /Users/user/.rvm/gems/ruby-1.9.3-p327
-e:1:in `initialize': wrong number of arguments(1 for 0) (ArgumentError)
from -e:1:in `new'
from -e:1:in `<main>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment