Project

General

Profile

Bug #5691

rb_path2class raises a NameError if a constant in the path exists on toplevel

Added by naruse (Yui NARUSE) over 7 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 2.0.0dev (2011-11-30 trunk 33906) [x86_64-freebsd9.0]
Backport:
[ruby-core:41410]

Description

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")'
-e:1:in rb_path2class': undefined class/module CApiClassSpecs::X (ArgumentError)
% ./ruby -r./spec/rubyspec/optional/capi/ext/class_spec.so -e'X=1;CApiClassSpecs.new.rb_path2class("CApiClassSpecs::X")'
-e:1:in
rb_path2class': uninitialized constant CApiClassSpecs::X (NameError)

Associated revisions

Revision f6f45343
Added by naruse (Yui NARUSE) over 7 years ago

  • 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]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33909 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 33909
Added by naruse (Yui NARUSE) over 7 years ago

  • 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]

Revision 33909
Added by naruse (Yui NARUSE) over 7 years ago

  • 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]

Revision 33909
Added by naruse (Yui NARUSE) over 7 years ago

  • 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]

Revision 33909
Added by naruse (Yui NARUSE) over 7 years ago

  • 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]

Revision 33909
Added by naruse (Yui NARUSE) over 7 years ago

  • 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]

Revision 33909
Added by naruse (Yui NARUSE) over 7 years ago

  • 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]

History

#1

Updated by naruse (Yui NARUSE) over 7 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]

Also available in: Atom PDF