summaryrefslogtreecommitdiff
path: root/object.c
diff options
context:
space:
mode:
authorcharliesome <charliesome@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-08-05 01:02:22 +0000
committercharliesome <charliesome@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-08-05 01:02:22 +0000
commit5e98991f1bf475cedff781e3ae2f2307c884f52d (patch)
tree061775479ddf4fc9c2af3745fcee9cb3107a4c80 /object.c
parentb649592c4ab31c5ac0cbbd0c5136b7cbbeb82c32 (diff)
downloadruby-5e98991f1bf475cedff781e3ae2f2307c884f52d.tar.gz
* object.c (rb_class_inherited_p): allow iclasses to be tested for
inheritance. [Bug #8686] [ruby-core:56174] * test/ruby/test_method.rb: add test git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42380 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'object.c')
-rw-r--r--object.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/object.c b/object.c
index 97419b03d6..3bcad9fea7 100644
--- a/object.c
+++ b/object.c
@@ -1519,7 +1519,7 @@ rb_class_inherited_p(VALUE mod, VALUE arg)
VALUE start = mod;
if (mod == arg) return Qtrue;
- if (!CLASS_OR_MODULE_P(arg)) {
+ if (!CLASS_OR_MODULE_P(arg) && !RB_TYPE_P(arg, T_ICLASS)) {
rb_raise(rb_eTypeError, "compared with non class/module");
}
arg = RCLASS_ORIGIN(arg);