Issue #6020 has been updated by Shyouhei Urabe.

Status changed from Open to Feedback

Can you show us your "expected behavior"?
----------------------------------------
Bug #6020: Unexpected is_a/kind_of behaviour
https://bugs.ruby-lang.org/issues/6020

Author: Alex N
Status: Feedback
Priority: Low
Assignee: 
Category: core
Target version: 
ruby -v: ruby 2.0.0dev (2012-02-14 trunk 34598) [x86_64-darwin11.3.0]


=begin
I've noticed some inconsistent is_a?/kind_of? methods behavior in a very special cases
 self.class #=> Object

 BasicObject.is_a?(BasicObject) #=> true
 Module.is_a?(Module) #=> true
 Class.is_a?(Class) #=> true
 Object.is_a?(Object) #=> true

 BasicObject.is_a?(Module) #=> true

 Integer.is_a?(Integer) #=> false
 class A; end
 A.is_a?(A) #=> false
 
 module B; end
 B.is_a?(B) #=> false

 class C < Object; end
 C.is_a?(C) #=> false
 C.is_a?(Object) #=> true
 C.is_a?(BasicObject) #=> true
 C.is_a?(Module) #=> true
 C.is_a?(Class) #=> true

 c = C.new
 c.is_a?(Module) #=> false
 c.is_a?(Class) #=> false

It looks like it's because Class, Module, Object and BasicObject have class Class, superclass is set properly. 
Anyway all is logical but not expected. 
=end




-- 
http://bugs.ruby-lang.org/