Project

General

Profile

Actions

Bug #6867

closed

super in a Mutex#synchronize block

Added by Eregon (Benoit Daloze) over 12 years ago. Updated almost 12 years ago.

Status:
Closed
Target version:
ruby -v:
ruby 2.0.0dev (2012-08-14 trunk 36700) [x86_64-darwin10.8.0]
Backport:
[ruby-core:47186]

Description

The following code:

require 'thread'

class Parent
def meth
end
end

class Child < Parent
def meth
Mutex.new.synchronize do
super
end
end
end

Child.new.meth

raises

bug_super.rb:13:in block in meth': can't find the method for super, which may be called in an orphan block (NoMethodError) from <internal:prelude>:10:in synchronize'
from bug_super.rb:12:in meth' from bug_super.rb:18:in '

I met the bug with the listen gem: https://github.com/guard/listen/blob/master/lib/listen/adapters/darwin.rb#L22-25 .


Files

fix.patch (1.79 KB) fix.patch tenderlovemaking (Aaron Patterson), 08/21/2012 02:41 AM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0