From: "qianthinking (Leon Li)" Date: 2012-09-13T13:18:11+09:00 Subject: [ruby-core:47503] [ruby-trunk - Bug #7018][Open] unexpected behavior that constant is overridden and redefined Issue #7018 has been reported by qianthinking (Leon Li). ---------------------------------------- Bug #7018: unexpected behavior that constant is overridden and redefined https://bugs.ruby-lang.org/issues/7018 Author: qianthinking (Leon Li) Status: Open Priority: Normal Assignee: Category: core Target version: 1.9.2 ruby -v: ruby 1.9.2p320 (2012-04-20 revision 35421) [x86_64-linux] module Foo module Bar end end include Foo m = Bar #Bar expected being opened, instead, it is overridden and redefined only in 1.9.2-p320 module Bar end puts "#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}: #{m == Bar}" $ rvm 1.8.7,1.9.2-p180,1.9.2-p290,1.9.2-p320,1.9.3-p0,1.9.3-p194 do ruby -e 'module Foo; module Bar; end; end; include Foo; m = Bar; module Bar; end; puts "#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}: #{m == Bar}"' 1.8.7-p357: true 1.9.2-p180: true 1.9.2-p290: true 1.9.2-p320: false 1.9.3-p0: true 1.9.3-p194: true -- http://bugs.ruby-lang.org/