Delegate does not pass block through when object does not implement method #1078

headius opened this Issue Oct 3, 2013 · 2 comments


None yet

2 participants

headius commented Oct 3, 2013

When the method being delegated to does not actually implement the called method, our native delegate logic (NativeDelegate) is not passing the block through to the call.

For example, this code produces an enumerator instead of the final array:

require 'delegate'

hash = { "key" => "value" }

class Wrapper < SimpleDelegator

wrapped_hash =

wrapped_wrapped_hash =

p { |key, value| [key,value] }

Fix coming.

@headius headius closed this in 2a8ff74 Oct 3, 2013
headius commented Oct 3, 2013

@atambo Can you turn your example into a test case? I'm trying to fix other things for release right now and will probably forget.

@atambo atambo added a commit that referenced this issue Oct 3, 2013
@atambo atambo Add test for fix to #1078 dd08c7b
atambo commented Oct 3, 2013

@headius, done in dd08c7b.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment