From: shibata.hiroshi@... Date: 2014-08-15T02:22:47+00:00 Subject: [ruby-core:64380] [ruby-trunk - Bug #8411] [Rejected] Wrong value returned when arity called on a method created through define_method with default arguments Issue #8411 has been updated by Hiroshi SHIBATA. Status changed from Open to Rejected this issue is affected only Ruby 1.9. ``` ruby 1.9.3p547 (2014-05-14) [x86_64-darwin13.4.0] -1 0 ruby 2.0.0p531 (2014-07-07 revision 46748) [x86_64-darwin13.4.0] -1 -1 ruby 2.1.2p200 (2014-08-11 revision 47141) [x86_64-darwin13.0] -1 -1 ruby 2.2.0dev (2014-08-14 trunk 47177) [x86_64-darwin13] -1 -1 ``` Ruby 1.9.3 is now in the security maintenance phase. ---------------------------------------- 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-48348 * Author: John Amicangelo * Status: Rejected * 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 -- https://bugs.ruby-lang.org/