Issue #3768 has been updated by Thomas Sawyer.


@Jeremy The very need of it is why I reported the issue.

The behavior is clearly broken. It's a pretty fundamental expectation that a subclass of BasicObject would have working constant lookup. To think otherwise is to assert that no subclass of BasicObject should ever be allowed to use delegation.

All I can say is thank goodness for const_missing, b/c if it wasn't for that BasicObject would be all but useless and I literally would not have been able to make two of my programs work correctly (well, without defining my own sub-optimal "BlankSlate" class).

At the VERY least add the work-around to BasicObject's documentation so others will know what to do when their code doesn't work.
----------------------------------------
Bug #3768: Constant Lookup doesn't work in a subclass of BasicObject
http://redmine.ruby-lang.org/issues/3768

Author: Thomas Sawyer
Status: Rejected
Priority: Normal
Assignee: Yukihiro Matsumoto
Category: lib
Target version: 
ruby -v: 1.9.2-p0


=begin
 ruby-1.9.2-p0 > module M
 ruby-1.9.2-p0 ?>  end
  => nil
 ruby-1.9.2-p0 > class X < BasicObject
 ruby-1.9.2-p0 ?>    include M
 ruby-1.9.2-p0 ?>  end
 NameError: uninitialized constant X::M
         from (irb):4:in `<class:X>'
         from (irb):3
         from /home/trans/.rvm/rubies/ruby-1.9.2-p0/bin/irb:17:in `<main>'
=end



-- 
http://redmine.ruby-lang.org