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

Unresolved super with module_function #3708

Closed
JacobUb opened this issue Mar 2, 2016 · 2 comments
Closed

Unresolved super with module_function #3708

JacobUb opened this issue Mar 2, 2016 · 2 comments
Labels
Milestone

Comments

@JacobUb
Copy link

JacobUb commented Mar 2, 2016

Using 9.0.5.0 on Windows:

module Foo
  module_function

  def load(file)
    super
  end
end

Foo.load("a file")

Error:

Unhandled Java exception: java.lang.NullPointerException
java.lang.NullPointerException: null
           unresolvedSuper at org/jruby/ir/runtime/IRRuntimeHelpers.java:958
  unresolvedSuperSplatArgs at org/jruby/ir/runtime/IRRuntimeHelpers.java:947
                      load at l2r.rb:645
                      call at org/jruby/internal/runtime/methods/CompiledIRMethod.java:131
                      call at org/jruby/internal/runtime/methods/DynamicMethod.java:197
                      call at org/jruby/internal/runtime/methods/WrapperMethod.java:59
              cacheAndCall at org/jruby/runtime/callsite/CachingCallSite.java:313
                      call at org/jruby/runtime/callsite/CachingCallSite.java:163
                     <top> at l2r.rb:649
                      load at org/jruby/ir/Compiler.java:111
                 runScript at org/jruby/Ruby.java:817
                 runScript at org/jruby/Ruby.java:809
               runNormally at org/jruby/Ruby.java:747
               runFromMain at org/jruby/Ruby.java:569
             doRunFromMain at org/jruby/Main.java:415
               internalRun at org/jruby/Main.java:310
                       run at org/jruby/Main.java:239
                      main at org/jruby/Main.java:201

Changing module_function to extend self correctly calls Kernel.load (and raises LoadError, as expected).

@enebo enebo added this to the JRuby 9.1.1.0 milestone Apr 22, 2016
@enebo enebo added the ir label Apr 22, 2016
@headius headius modified the milestones: JRuby 9.1.1.0, JRuby 9.1.2.0 May 11, 2016
@enebo enebo modified the milestones: JRuby 9.1.2.0, JRuby 9.1.3.0 May 23, 2016
@headius
Copy link
Member

headius commented Aug 16, 2016

Still happens in JRuby 9.1.3.0 (master).

@headius
Copy link
Member

headius commented Aug 16, 2016

I believe I have a fix. Testing locally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants