Skip to content

Not every class has a superclass? #4528

@ioquatix

Description

@ioquatix

It seems like sometimes ObjectSpace.each_object(Class).collect(&:superclass) may fail in JRuby but works fine in MRI.

Example of failure here: https://travis-ci.org/rubyworks/facets/jobs/209292853

    undefined method `superclass' for #<Class:Java::OrgJrubyExtPsych>
    lib/core/facets/class/subclasses.rb:20
    18       list = []
    19       ObjectSpace.each_object(Class) do |c|
 => 20         list.unshift c if c.superclass == self
    21       end
    22       list.uniq

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions