Project

General

Profile

Actions

Bug #3792

closed

Procs created via Method#to_proc and Symbol#to_proc don't pass a block thru

Added by tmat (Tomas Matousek) over 14 years ago. Updated over 13 years ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 1.9.2p0 (2010-08-18) [i386-mingw32]
Backport:
[ruby-core:32075]

Description

=begin
class C
def foo
yield
end
end

f = :foo.to_proc
f.(C.new) { puts 'bar' } rescue p $!

m = C.new.method(:foo)
q = m.to_proc
q.() { puts 'bar' } rescue p $!

Output:

#<LocalJumpError: no block given (yield)>
#<LocalJumpError: no block given (yield)>

Expected:
bar
bar
=end

Actions #1

Updated by sorah (Sorah Fukumori) over 14 years ago

=begin
I think it is spec.

--
Shota Fukumori a.k.a. @sora_h - http://codnote.net/

=end

Actions #2

Updated by shyouhei (Shyouhei Urabe) over 14 years ago

  • Status changed from Open to Assigned
  • Assignee set to nobu (Nobuyoshi Nakada)
Actions #3

Updated by nobu (Nobuyoshi Nakada) about 14 years ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

=begin
This issue was solved with changeset r29335.
Tomas, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.

=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0