Calling super() outside of a method causes NPE #4426

Closed
retoo opened this Issue Jan 7, 2017 · 0 comments

Projects

None yet

2 participants

@retoo
Contributor
retoo commented Jan 7, 2017

run the attached project, tested with 9.1.6.0 and master branch.

npesuper.tar.gz

jruby 9.1.6.0:

LoadError: load error: b -- java.lang.NullPointerException: null
  require at org/jruby/RubyKernel.java:959
   <main> at run.rb:5

plain ruby:

NoMethodError: super: no superclass method `' for Foo:Class
  method_missing at org/jruby/RubyBasicObject.java:1655
     <class:Foo> at foo.rb:2
          <main> at foo.rb:1

Workaround: don't call super within the class body :)

@retoo retoo added a commit to retoo/jruby that referenced this issue Jan 7, 2017
@retoo retoo Don't allow null method names
Solves #4426
567c11c
@kares kares closed this Jan 7, 2017
@kares kares added this to the JRuby 9.1.7.0 milestone Jan 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment