Project

General

Profile

Bug #3792

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

Added by tmat (Tomas Matousek) over 10 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Normal
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:

#
#

Expected:
bar
bar
=end

#1

Updated by sorah (Sorah Fukumori) over 10 years ago

=begin
I think it is spec.

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

=end

#2

Updated by shyouhei (Shyouhei Urabe) over 10 years ago

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

Updated by nobu (Nobuyoshi Nakada) over 10 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

Also available in: Atom PDF