Project

General

Profile

Actions

Bug #12671

closed

Hash#to_proc result is not a lambda, but enforces arity

Added by headius (Charles Nutter) over 8 years ago. Updated over 4 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin14]
[ruby-core:76846]

Description

 $ ruby23 -e 'pr = {foo:1}.to_proc; puts pr.lambda?; pr.call rescue puts $!; pr.call(1, 2) rescue puts $!'
false
wrong number of arguments (given 0, expected 1)
wrong number of arguments (given 2, expected 1)

I believe it should be marked as a lambda, since it enforces arity.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0