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

Refines coming from included modules aren't recognized by jruby #4489

Closed
najamelan opened this issue Feb 13, 2017 · 3 comments
Closed

Refines coming from included modules aren't recognized by jruby #4489

najamelan opened this issue Feb 13, 2017 · 3 comments
Milestone

Comments

@najamelan
Copy link

@najamelan najamelan commented Feb 13, 2017

Environment

jruby -v : jruby 9.1.7.0 (2.3.1) 2017-01-11 68056ae OpenJDK 64-Bit Server VM 25.121-b13 on 1.8.0_121-8u121-b13-2-b13 +jit [linux-x86_64]
uname -a : Linux computer 4.9.0-1-amd64 #1 SMP Debian 4.9.2-2 (2017-01-12) x86_64 GNU/Linux

Expected Behavior

This works on MRI:

module A
  refine String do
    def foo; puts :foo; end
  end
end

module B
  refine String do
    def bar; puts :bar; end
  end
end

module C
  include A, B
end

using C

"blah".foo
"blah".bar

On jruby it doesn't take the refine :(

Actual Behavior

$ jruby test.rb
NoMethodError: undefined method `foo' for "blah":String
  <main> at test.rb:19

As discussed in #4475

@headius
Copy link
Member

@headius headius commented Feb 13, 2017

Thank you! We shall endeavor to fix it :-)

@headius
Copy link
Member

@headius headius commented Feb 26, 2019

JRuby output matches MRI 2.5.3 after #5604 and #5627.

@headius headius added this to the JRuby 9.2.7.0 milestone Feb 26, 2019
@headius
Copy link
Member

@headius headius commented Mar 7, 2019

Both PRs and additional fixes have been merged.

@headius headius closed this Mar 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants