mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Set origin when doing kind_of? comparisons
This commit is contained in:
@@ -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
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user