Skip to content

Superfluous Object:: in module name #3683

@fxn

Description

@fxn

Hi! I am replacing TracePoint with Module#const_added in Zeitwerk, and noticed the new test suite does not pass on TruffleRuby (this work is still not released).

The root cause is this:

class Module
  def const_added(cname)
    puts const_get(cname).name
  end
end

module M
end

That prints "Object::M", instead of "M".

I suspect it is related to internal callback logic specifically, because M.name is "M" later.

Version is

% ruby -v
truffleruby 24.1.0, like ruby 3.2.4, Oracle GraalVM JVM [arm64-darwin20]

/cc @byroot

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions