Skip to content

Object.const_defined? not respecting namespace check #3901

Open
@HoneyryderChuck

Description

@HoneyryderChuck

👋 reported the same issue for jruby, and can observe the same thing happening when using truffleruby 24.2.1.

Expected Behavior

Given the following snippet, I'd expect the const not to be defined:

Object.const_set :Bang, Module.new
p Object.const_defined?("Bang::Struct") #=>should be false

Actual Behavior

The snippet above returns true, false in cruby. The latter is correct.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions