Project

General

Profile

Actions

Feature #13257

closed

Symbol#singleton_class should be undef

Added by tagomoris (Satoshi Tagomori) about 7 years ago. Updated almost 4 years ago.

Status:
Feedback
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

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0