Set origin when doing kind_of? comparisons

This commit is contained in:
Blaž Hrastnik
2015-07-13 23:35:30 +02:00
parent b0fb9ccfd8
commit 8c13e2b7c6
2 changed files with 5 additions and 4 deletions
+1
View File
@@ -487,6 +487,7 @@ mrb_obj_is_kind_of(mrb_state *mrb, mrb_value obj, struct RClass *c)
mrb_raise(mrb, E_TYPE_ERROR, "class or module required");
}
c = c->origin;
while (cl) {
if (cl == c || cl->mt == c->mt)
return TRUE;
+4 -4
View File
@@ -543,21 +543,21 @@ assert('Module#prepend') do
b = labeled_module('b') { include a }
c = labeled_module('c') { prepend b }
assert bug6654 do
#assert bug6654 do
# the Module#< operator should be used here instead, but we don't have it
assert_include(c.ancestors, a)
assert_include(c.ancestors, b)
end
#end
bug8357 = '[ruby-core:54736] [Bug #8357]'
b = labeled_module('b') { prepend a }
c = labeled_class('c') { include b }
assert bug8357 do
#assert bug8357 do
# the Module#< operator should be used here instead, but we don't have it
assert_include(c.ancestors, a)
assert_include(c.ancestors, b)
end
#end
bug8357 = '[ruby-core:54742] [Bug #8357]'
assert_kind_of(b, c.new, bug8357)