Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'proc' without argument does not return the procified-block passed to the method #4456

Closed
doudou opened this issue Jan 25, 2017 · 1 comment

Comments

@doudou
Copy link

doudou commented Jan 25, 2017

Environment

jruby 9.1.7.0 (2.3.1) 2017-01-11 68056ae Java HotSpot(TM) 64-Bit Server VM 25.121-b13 on 1.8.0_121-b13 +jit [linux-x86_64]
Ubuntu 16.04, jruby installed through rbenv

Expected and actual behaviors

The following code

def m
   proc
end

puts m { 10 }

raises under jruby

ArgumentError: tried to create Proc object without a block
    proc at org/jruby/RubyKernel.java:1273
       m at m.rb:2
  <main> at m.rb:4

but under MRI, proc without a block returns the procified block given as argument to the method (proc's documentation points to Proc.new and https://ruby-doc.org/core-2.4.0/Proc.html#method-c-new)

#<Proc:0x000000008a8b08@flat_fish-jruby917/m.rb:4>
@doudou
Copy link
Author

doudou commented Jan 25, 2017

Sorry for the noise ... I did not search in existing issues. Duplicate of #3915

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants