-
-
Notifications
You must be signed in to change notification settings - Fork 925
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
Module#included is private when called with super #3008
Labels
Milestone
Comments
Interesting. Will have a look. |
Simple reproduction: module A
def included(base)
super
end
end
module B
class << self
prepend A
end
end
class C
include B
end |
This logic in if (method.isUndefined() || (superClass.isPrepended() && (method.isImplementedBy(self.getType())))) {
rVal = Helpers.callMethodMissing(context, self, method.getVisibility(), methodName, CallType.SUPER, args, block);
} else { |
@headius awesome work, will verify again when RC1 is out. |
headius
added a commit
to ruby/spec
that referenced
this issue
Jun 3, 2015
eregon
added a commit
that referenced
this issue
Jun 3, 2015
71ff5e4 Remove unintended tabs in spec. 32dbc10 Method scopes default to public visibility for def. 6209f82 Add spec for prepend behavior from #3008. 1d62f36 Split the Complex#hash spec into smaller examples. 716c2f1 Remove invalid assertion in SizedQueue#enq spec. bbd6d3b Remove the Dir glob encoding spec. f55ce4a Cleanup __method__ and __callee__ specs. git-subtree-dir: spec/ruby git-subtree-split: 71ff5e4dac390e1304a9da3af99cd4b915dad467
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I came across this issue when trying out one of my libraries on jruby 9000 pre2. The relevant source code is here: https://github.com/Saltside/thrift-base64-ruby/blob/master/lib/thrift/base64.rb#L22-51
Note the comment about using
prepend
andincluded
. The code fails on 9000.pre2 like so:I could remove my work around and use
included
like normal, but it seems strange that a method would change scope when invoked withsuper
.This is easily to replicate. Clone that library and run the tests on 9000.pre2.
The text was updated successfully, but these errors were encountered: