Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Refinements in method bodies aren't activated #3548
(Moved from a comment in #1062)
I've hit some strange behaviour trying to use refinements with version 188.8.131.52:
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
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 184.108.40.206?