Actions
Bug #14407
closeddefined? still returning true for top-level constant when referenced with scope
    Bug #14407:
    defined? still returning true for top-level constant when referenced with scope
  
Description
class A
end
class B
end
if defined?(A::B)
  puts "defined"
  puts A::B
else
  puts "not defined"
end
When running this script with ruby 2.5.0 i get:
defined
Traceback (most recent call last):
test.rb:10:in `<main>': uninitialized constant A::B (NameError)
Did you mean?  B
while my expectation was that after the top-level constant lookup was removed from ruby 2.5, defined? would return false and i would actually get
not defined
as output
Actions