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

Unexpected call of refined method #4840

Open
bjfish opened this Issue Nov 5, 2017 · 0 comments

Comments

Projects
None yet
2 participants
@bjfish
Contributor

bjfish commented Nov 5, 2017

Environment

Provide at least:

  • JRuby version (jruby -v) and command line (flags, JRUBY_OPTS, etc)
    Tested at commit 96f88cd and version jruby-9.1.9.0

  • Operating system and platform (e.g. uname -a):
    Darwin Kernel Version 16.7.0

Expected Behavior

Example

class ClassOne
  def method_to_refine
    puts "ClassOne#method_to_refine unrefined"
  end 
end

module RefinementModuleOne
end

module RefinementModuleTwo
  refine ClassOne do
    def method_to_refine
      puts "ClassOne#method_to_refine in RefinementModuleTwo"
    end
  end
end

class ClassUsingRefinements
  using RefinementModuleOne

  def one
    ClassOne.new.method_to_refine
  end

  using RefinementModuleTwo
  
  def two
    ClassOne.new.method_to_refine
  end
end

c = ClassUsingRefinements.new
c.one
c.two

Expected Output (MRI 2.3.4/2.4.1)

ClassOne#method_to_refine unrefined
ClassOne#method_to_refine in RefinementModuleTwo

Actual Behavior

ClassOne#method_to_refine in RefinementModuleTwo
ClassOne#method_to_refine in RefinementModuleTwo

@headius headius added this to the JRuby 9.2.0.0 milestone Nov 9, 2017

@headius headius modified the milestones: JRuby 9.2.0.0, JRuby 9.2.1.0 May 17, 2018

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