diff --git a/ChangeLog b/ChangeLog index 90cc73873a..5cab630893 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Wed Jan 12 00:36:29 2005 Nobuyoshi Nakada + + * object.c (rb_class_superclass): superclass of singleton class also + should be a singleton class. fixed: [ruby-list:40519] + Tue Jan 11 20:58:52 2005 Nobuyoshi Nakada * io.c (remain_size): use buffered data instead of unreading to avoid diff --git a/object.c b/object.c index 308e1dc8d7..13f16b1c80 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; }