< :前の番号
^ :番号順リスト
> :次の番号
P :前の記事(スレッド移動)
N :次の記事(スレッド移動)
|<:前のスレッド
>|:次のスレッド
^ :返事先
_:自分への返事
>:同じ返事先を持つ記事(前)
<:同じ返事先を持つ記事(後)
---:分割してスレッド表示、再表示
| :分割して(縦)スレッド表示、再表示
~ :スレッドのフレーム消去
.:インデックス
..:インデックスのインデックス
Issue #7695 has been reported by trans (Thomas Sawyer).
----------------------------------------
Bug #7695: Constant Lookup - For goodness sake it should at least see itself!
https://bugs.ruby-lang.org/issues/7695
Author: trans (Thomas Sawyer)
Status: Open
Priority: Normal
Assignee:
Category: core
Target version: next minor
ruby -v: ruby 1.9.3p327 (2012-11-10 revision 37606) [x86_64-linux]
=begin
Example:
>> module Foo; end
>> module Foo::Bar
>> p Bar
>> end
NameError: uninitialized constant Foo::Bar::Bar
from (irb):3:in `<module:Bar>'
from (irb):2
from /opt/Ruby/1.9.3-p327/bin/irb:12:in `<main>'
While I understand the technical details of constant lookup and why this happens, it just seems plan wrong on the face of it. Why wouldn't a module/class not at least see ((*itself*))!?
For use case -- I was writing some code and I determined that a whole set of classes should be under a secondary namespace. It was convenient to go from `module Realms` to `class Realms::Library`, but alas, it broke the code, because none of the code inside could see `Library` anymore. So I had to go through all the files, use two lines instead on one, i.e. `module Realms` then `class Library`, indent every line another tab and finally add another `end` at the bottom of each file. A pain in the arse!
While it might not technically be a "bug", I am going to go ahead and file it as one b/c to me it really seems like one. And if I didn't know exactly how constant lookup worked I would think it one too.
=end
--
http://bugs.ruby-lang.org/