-
-
Notifications
You must be signed in to change notification settings - Fork 925
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
[2.1] Refinements #1062
Comments
I realized if I land this in its current 50%+ working state it will not work in JIT since in this form it still has a refinedcallinstr vs using a refinedcallsite. Even had I made that change the JIT would still need some work so I am deferring this until next 9k release. |
At the point of pre2 we are passing a substantial portion of refinement tests but we have quite a few significant failing tests (see test/mri). So more work to do before RC |
Any progress on this? |
I've hit some strange behaviour trying to use refinements with version 9.0.4.0: module Refinement
refine Object do
def new_method
'new method!'
end
end
end
class Thing
using Refinement
p in_class_definition: Object.new.new_method
def test
p in_method: Object.new.new_method
end
end
Thing.new.test outputs
It seems like there's something amiss with the lexical scoping of the method; in MRI, methods defined with the lexical scope where a refinement is activated can make use of that refinement. Is this expected behaviour in JRuby as of 9.0.4.0? |
Another related issue: #2977. |
Refinements have been pared back to a much more reasonable form that does not have performance implications for unrefined code. They will ship as an official feature in 2.1.
We need to implement refinements in JRuby, at least as an experiment, as soon as possible to know whether they have undiscovered issues. Once they ship in 2.1 it will be much harder to fix them.
I'm marking this for 1.7.6, since I want to do the experiment ASAP.
https://bugs.ruby-lang.org/projects/ruby-trunk/wiki/RefinementsSpec
The text was updated successfully, but these errors were encountered: