[#69084] [Ruby trunk - Feature #11124] [Open] [PATCH] lib/*: use monotonic clock for timeouts — normalperson@...
Issue #11124 has been reported by Eric Wong.
5 messages
2015/05/06
[#69138] [Ruby trunk - Feature #11136] [PATCH] webrick: avoid fcntl module — nobu@...
Issue #11136 has been updated by Nobuyoshi Nakada.
3 messages
2015/05/12
[#69160] [Ruby trunk - Feature #11146] [PATCH] variable.c: initialize generic_iv_tbl at start — nobu@...
Issue #11146 has been updated by Nobuyoshi Nakada.
4 messages
2015/05/13
[#69175] Re: [Ruby trunk - Feature #11146] [PATCH] variable.c: initialize generic_iv_tbl at start
— Eric Wong <normalperson@...>
2015/05/13
nobu@ruby-lang.org wrote:
[ruby-core:69079] [Ruby trunk - Bug #10702] Constant look up inconsistency with constants defined in included modules
From:
kwstannard@...
Date:
2015-05-05 14:15:06 UTC
List:
ruby-core #69079
Issue #10702 has been updated by Kelly Stannard.
Thanks for the response. I can't say that it is intuitive at all, but I think I get what is happening now.
----------------------------------------
Bug #10702: Constant look up inconsistency with constants defined in included modules
https://bugs.ruby-lang.org/issues/10702#change-52326
* Author: Kelly Stannard
* Status: Rejected
* Priority: Normal
* Assignee:
* ruby -v: 2.2-head
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
https://gist.github.com/kwstannard/c0f722976ba023cc5755
```ruby
module A
module B
end
end
module C
include A
puts B.inspect # => A::B
class D
puts B.inspect rescue puts 'failed' # => failed
end
B = B
class E
puts B.inspect # => A::B
end
end
```
When you include a module you gain access to that module's constants as seen in line 9. Line 19 shows that you can get constants defined in the nested module when the constant is defined within the module itself.
Line 12 is the bug. Shouldn't class `D` be able to access module `B` since the previous line shows that module `C` has access to Module `B`?
--
https://bugs.ruby-lang.org/