rb_path2class raises a NameError if a constant in the path exists on toplevel
An exception from rb_path2class differs on strange context.
% ./ruby -r./spec/rubyspec/optional/capi/ext/class_spec.so -e'CApiClassSpecs.new.rb_path2class("CApiClassSpecs::X")'
rb_path2class': undefined class/module CApiClassSpecs::X (ArgumentError)rb_path2class': uninitialized constant CApiClassSpecs::X (NameError)
% ./ruby -r./spec/rubyspec/optional/capi/ext/class_spec.so -e'X=1;CApiClassSpecs.new.rb_path2class("CApiClassSpecs::X")'
Updated by naruse (Yui NARUSE) over 8 years ago
- Status changed from Open to Closed
- % Done changed from 0 to 100
This issue was solved with changeset r33909.
Yui, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
- variable.c (rb_path2class): don't raise NameError when the middle constant of the path is not defined but defined on toplevel. [ruby-core:41410] [Bug #5691]