-
-
Notifications
You must be signed in to change notification settings - Fork 942
Closed
Milestone
Description
module E; end
module Foo
FOO = 42
prepend E # remove me, or change prepend => include
end
class X
include Foo
def m
p FOO
end
end
X.new.m # => should print 42. Instead:
# NameError: uninitialized constant X::FOO
# Did you mean? Foo
# const_missing at org/jruby/RubyModule.java:3747
# m at bug.rb:12
# <main> at bug.rb:16As in the comment, if E is included instead of prepended, or not in the ancestors at all, the code works as expected. I tested in Ruby 2.7 and 2.0 just for kicks, all work.
$ ruby -v
jruby 9.2.9.0 (2.5.7) 2019-10-30 458ad3e Java HotSpot(TM) 64-Bit Server VM 9.0.1+11 on 9.0.1+11 +jit [darwin-x86_64]Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels