Issue #8411 has been updated by steveklabnik (Steve Klabnik).


On my Ruby 2.0.0 and 2.1.0-dev, I get -1 and -1, so something was fixed somewhere.
----------------------------------------
Bug #8411: Wrong value returned when arity called on a method created through define_method with default arguments
https://bugs.ruby-lang.org/issues/8411#change-40939

Author: JFlash (John Amicangelo)
Status: Open
Priority: Normal
Assignee: 
Category: 
Target version: 
ruby -v: ruby 1.9.3p429 (2013-05-15 revision 40747) [x86_64-darwin12.3.0]
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN


 def foo(bizz=:bizz, baz=:baz, buzz=:buzz)
 end
 
 Object.send(:define_method, :bar) do |bizz=:bizz, baz=:baz, buzz=:buzz|
 end
 
 puts method(:foo).arity
 puts method(:bar).arity

Expected:
-1
-1

Actual:
-1
0


-- 
http://bugs.ruby-lang.org/
_______________________________________________
ruby-core mailing list
ruby-core / ruby-lang.org
http://lists.ruby-lang.org/cgi-bin/mailman/listinfo/ruby-core