From: "therevmj (Michael Johnson)" Date: 2012-10-26T09:19:02+09:00 Subject: [ruby-core:48292] [ruby-trunk - Bug #7216][Open] object.c defines clone method for objects that cannot be cloned. Issue #7216 has been reported by therevmj (Michael Johnson). ---------------------------------------- Bug #7216: object.c defines clone method for objects that cannot be cloned. https://bugs.ruby-lang.org/issues/7216 Author: therevmj (Michael Johnson) Status: Open Priority: Normal Assignee: Category: core Target version: ruby -v: all versions up to current trunk As the subject says, in object.c, the clone method is defined and then special cased for certain object types. The end result is that all respond_to?(:clone) returns true for all objects, but then thows an fatal error in some cases. Here is an appropriate example: >> a = true => true >> a.respond_to?(:clone) => true >> a.clone TypeError: can't clone TrueClass from (irb):3:in `clone' from (irb):3 Ultimately, the objects that do no respond to 'clone' should have it removed so that the respond_to? method returns false. -- http://bugs.ruby-lang.org/