Project

General

Profile

Actions

Bug #5691

closed

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

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

Status:
Closed
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)

Actions #1

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

Also available in: Atom PDF

Like0
Like0