From 8d239337eee9c0dad5eb6a3d8631eae35835bf5f Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 11 Jan 2005 15:36:52 +0000 Subject: * object.c (rb_class_superclass): superclass of singleton class also should be a singleton class. fixed: [ruby-list:40519] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@7768 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- object.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'object.c') diff --git a/object.c b/object.c index 308e1dc8d..13f16b1c8 100644 --- a/object.c +++ b/object.c @@ -1587,6 +1587,9 @@ rb_class_superclass(klass) if (!super) { rb_raise(rb_eTypeError, "uninitialized class"); } + if (FL_TEST(klass, FL_SINGLETON)) { + super = RBASIC(klass)->klass; + } while (TYPE(super) == T_ICLASS) { super = RCLASS(super)->super; } -- cgit