Skip to content

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

@retoo

Description

@retoo

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 :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions