Project

General

Profile

Bug #3423

Inconsistent behaviour of Module#const_get with included modules

Added by judofyr (Magnus Holm) over 10 years ago. Updated about 9 years ago.

Status:
Closed
Priority:
Normal
Target version:
ruby -v:
ruby 1.9.2dev (2010-05-31 revision 28117) [x86_64-darwin10.3.0]
Backport:
[ruby-core:30720]

Description

=begin
module Foo
A = 1
end

class Object
include Foo
end

class Bar
include Foo
end

Object.const_get(:A, false) # => works fine
Bar.const_get(:A, false) # => raises error

Untested patch attached. This might also fix #3422.
=end


Files

yay.diff (389 Bytes) yay.diff judofyr (Magnus Holm), 06/11/2010 04:16 AM

Related issues

Related to Ruby master - Bug #5264: Commit 33157Closed09/02/2011Actions
Has duplicate Ruby master - Bug #3422: Object.const_get(:A, false) can access BasicObject::AClosedkosaki (Motohiro KOSAKI)06/11/2010Actions

Also available in: Atom PDF