From: Nobuyoshi Nakada Date: 2007-07-29T06:17:36+09:00 Subject: Re: Quarks Hi, At Sun, 29 Jul 2007 01:21:46 +0900, Trans wrote in [ruby-talk:262287]: > Why? Maybe a bug. Index: class.c =================================================================== --- class.c (revision 12852) +++ class.c (working copy) @@ -600,9 +600,18 @@ class_instance_method_list(int argc, VAL list = st_init_numtable(); - for (; mod; mod = RCLASS(mod)->super) { + if (mod) { st_foreach(RCLASS(mod)->m_tbl, method_entry, (st_data_t)list); - if (BUILTIN_TYPE(mod) == T_ICLASS) continue; - if (FL_TEST(mod, FL_SINGLETON)) continue; - if (!recur) break; + if (recur) { + while ((mod = RCLASS(mod)->super) != 0) { + st_foreach(RCLASS(mod)->m_tbl, method_entry, (st_data_t)list); + } + } +#define HIDDEN_CLASS_P(mod) ((BUILTIN_TYPE(mod) == T_ICLASS) || \ + (FL_TEST(mod, FL_SINGLETON))) + else if (HIDDEN_CLASS_P(mod)) { + while ((mod = RCLASS(mod)->super) != 0 && HIDDEN_CLASS_P(mod)) { + st_foreach(RCLASS(mod)->m_tbl, method_entry, (st_data_t)list); + } + } } ary = rb_ary_new(); -- Nobu Nakada