From: Denis de Bernardy Date: 2012-02-28T02:03:03+09:00 Subject: [ruby-core:42979] [ruby-trunk - Bug #6097][Open] Weird constant behavior during inheritance... Issue #6097 has been reported by Denis de Bernardy. ---------------------------------------- Bug #6097: Weird constant behavior during inheritance... https://bugs.ruby-lang.org/issues/6097 Author: Denis de Bernardy Status: Open Priority: Normal Assignee: Category: Target version: ruby -v: 1.9.3 >> class Parent >> class Child >> def foo >> end >> end >> end => nil >> class Test < Parent >> end => nil >> Test.const_defined?(:Child) => true >> class Test >> class Child >> def bar >> end >> end >> end => nil >> Test::Child.new.respond_to?(:bar) => true >> Parent::Child.new.respond_to?(:bar) => false # true expected... Obviously, testing the object_id shows that Parent::Child and Test::Child are not the same class, but is this to be expected? -- http://bugs.ruby-lang.org/