truffleruby icon indicating copy to clipboard operation
truffleruby copied to clipboard

Object.const_defined? not respecting namespace check

Open HoneyryderChuck opened this issue 5 months ago • 1 comments

👋 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.

HoneyryderChuck avatar Jun 12 '25 07:06 HoneyryderChuck