diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-04-21 19:16:40 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-04-21 19:16:40 +0000 |
| commit | 8630b6b0b0a5cf6e29cbb8717ebcc942fec5be67 (patch) | |
| tree | 2fc23fc96b14d2ca655464352904e5bdfc799197 /eval.c | |
| parent | c67dbe21fae4508dc8a75c6c08267cce454a2d52 (diff) | |
| download | ruby-8630b6b0b0a5cf6e29cbb8717ebcc942fec5be67.tar.gz ruby-8630b6b0b0a5cf6e29cbb8717ebcc942fec5be67.tar.xz ruby-8630b6b0b0a5cf6e29cbb8717ebcc942fec5be67.zip | |
* eval.c (rb_mod_define_method): allow binding methods to modules.
[ruby-dev:23410]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@6194 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
| -rw-r--r-- | eval.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -9098,7 +9098,8 @@ rb_mod_define_method(argc, argv, mod) if (FL_TEST(rklass, FL_SINGLETON)) { rb_raise(rb_eTypeError, "cannot bind singleton method to a different class"); } - if (RCLASS(rklass)->super && !RTEST(rb_class_inherited_p(mod, rklass))) { + if (RCLASS(mod)->super && RCLASS(rklass)->super && + !RTEST(rb_class_inherited_p(mod, rklass))) { rb_raise(rb_eTypeError, "bind argument must be a subclass of %s", rb_class2name(rklass)); } |
