Project

General

Profile

Bug #13257

Updated by tagomoris (Satoshi TAGOMORI) over 2 years ago

Objects of some classes doesn't have singleton classes (e.g., Symbol, Integer, Float...).
Symbol#singleton_class raises TypeError.

But Symbol#respond_to?(:singleton_class) returns true, and we cannot know when #singleton_class `#singleton_class` returns a valid class or raise errors in any way (except for calling it).

I think that

Symbol#respond_to?(:singleton_class) should return false for
such #singleton_class methods should be undef. cases. (Integer, Float and other classes without singleton_class too.)

Back