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

Projects
None yet
1 participant
@headius
Copy link
Member

commented Jun 11, 2018

Fixes #2212.

@headius headius added this to the JRuby 9.2.1.0 milestone Jun 11, 2018

@headius

This comment has been minimized.

Copy link
Member Author

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

@headius headius force-pushed the headius:clone_proc_for_define branch from 658bae1 to f03fc20 Jun 11, 2018

@headius headius added the core label Jun 12, 2018

@headius headius merged commit 13130e2 into jruby:master Jun 12, 2018

1 check failed

continuous-integration/travis-ci/pr The Travis CI build failed
Details

@headius headius deleted the headius:clone_proc_for_define branch Jun 12, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.