Skip to content

Method overriding new does not have super_method from Class #7546

@godfat

Description

@godfat

Environment Information

Provide at least:

  • JRuby version (jruby -v) and command line (flags, JRUBY_OPTS, etc)

    jruby 9.4.0.0 (3.1.0) 2022-11-23 95c0ec159f OpenJDK 64-Bit Server VM 19.0.1+10 on 19.0.1+10 +jit [x86_64-linux]
    
  • Operating system and platform (e.g. uname -a)

    Linux li1544-77 5.13.4-x86_64-linode146 #1 SMP Wed Jul 21 14:45:45 EDT 2021 x86_64 GNU/Linux
    

Expected Behavior

Print true with this line:

jruby -ve 'p Class.new{ def self.new; end }.method(:new).super_method.owner == Class'

Or indented code:

klass = Class.new do
  def self.new
  end
end

p klass.method(:new).super_method.owner == Class

Output:

true

Actual Behavior

Output:

false

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions