Project

General

Profile

Actions

Feature #13257

open

Symbol#singleton_class should be undef

Added by tagomoris (Satoshi TAGOMORI) over 4 years ago. Updated over 1 year ago.

Status:
Feedback
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:79797]
Tags:

Description

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 returns a valid class or raise errors in any way (except for calling it).

I think that such #singleton_class methods should be undef.

Actions

Also available in: Atom PDF