From: zverok.offline@... Date: 2020-02-18T18:02:08+00:00 Subject: [ruby-core:97193] [Ruby master Bug#16640] Symbol#to_proc reports -1 for arity Issue #16640 has been updated by zverok (Victor Shepelev). #9250 was closed with the reason > The proc created by Symbol#to_proc is not a lambda, but a proc But in #16260, it was discussed that `Symbol#to_proc` behaves more like lambda, and so hopefully all of its introspection methods (`#lambda?`, `#arity`, `#parameters`) will be fixed. ---------------------------------------- Bug #16640: Symbol#to_proc reports -1 for arity https://bugs.ruby-lang.org/issues/16640#change-84301 * Author: kddeisz (Kevin Deisz) * Status: Open * Priority: Normal * Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN ---------------------------------------- When you create a proc using Symbol#to_proc syntax, it reports the arity as -1, even though the required number of arguments is actually 1. This can happen based on `lambda(&:hash)`, `proc(&:hash)`, or `some_method(&:hash)`. Opened a PR with a fix here: https://github.com/ruby/ruby/pull/2913. -- https://bugs.ruby-lang.org/ Unsubscribe: