Skip to content

Object.const_defined? not respecting namespace check. #8867

Open
@HoneyryderChuck

Description

@HoneyryderChuck

Environment Information

  • JRuby version: "jruby 10.0.0.1 (3.4.2) 2025-05-07 79cf1e4aec OpenJDK 64-Bit Server VM 24.0.1+9-30 on 24.0.1+9-30 +indy +jit [x86_64-darwin]"
  • Operating system and platform: Darwin MacBook-Pro.local 24.5.0 Darwin Kernel Version 24.5.0: Tue Apr 22 19:53:26 PDT 2025; root:xnu-11417.121.6~2/RELEASE_X86_64 x86_64

Expected Behavior

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

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

Actual Behavior

The snippet above returns true in jruby 10.0.0.1, false in cruby.

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