Module reopen doesn't work for included module
----------------------------------------------
Key: JRUBY-5148
URL: http://jira.codehaus.org/browse/JRUBY-5148
Project: JRuby
Issue Type: Bug
Components: Ruby 1.8.7
Affects Versions: JRuby 1.5.3, JRuby 1.5.1
Environment: Windows XP, JRuby 1.5.1 and 1.5.3
Reporter: ben
See this code, it worked in MRI 1.8.7, but failed in JRuby 1.5.1 and 1.5.3 for
the last statement.
module A
module B
def self.output
puts "output A::B"
end
end
end
A::B.output
include A
B.output
module B
def self.diag
puts "diag B"
end
end
B.diag
B.output
>>> MRI results:
output A::B
output A::B
diag B
output A::B
>>> JRuby output:
output A::B
output A::B
diag B
m.rb:22: undefined method `output' for B:Module (NoMethodError)
After "include A", you can use module B directly, JRuby will create a brand new
module instead of reopening module B.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email