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

Clone proc blocks as well so they have their own frame etc. #5214

Merged
merged 1 commit into from
Jun 12, 2018

Conversation

headius
Copy link
Member

@headius headius commented Jun 11, 2018

Fixes #2212.

@headius headius added this to the JRuby 9.2.1.0 milestone Jun 11, 2018
@headius
Copy link
Member Author

headius commented Jun 11, 2018

This also needs specs. The example case from #2212 also fails to super properly without this patch:

class A
  def a
    p :a
  end
end

PROC = proc {p :proc; super}

class B < A
  define_method(:a, PROC)
  define_method(:b, PROC)
end

B.new.a

Which produces the following error (without my fix):

$ jruby blah2.rb 
:proc
NoMethodError: super: no superclass method `b' for #<B:0x27f723>
  block in blah2.rb at blah2.rb:7
             <main> at blah2.rb:14

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

Successfully merging this pull request may close these issues.

1 participant