1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* eval.c (rb_mod_define_method): allow binding methods to modules.

[ruby-dev:23410]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6194 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2004-04-21 19:16:40 +00:00
parent fb3c76a225
commit c94f8ab926
2 changed files with 7 additions and 1 deletions

View file

@ -1,3 +1,8 @@
Thu Apr 22 04:16:34 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* eval.c (rb_mod_define_method): allow binding methods to modules.
[ruby-dev:23410]
Wed Apr 21 23:04:42 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
* lib/rinda/rinda.rb, test/rinda/test_rinda.rb: check Hash tuple size.

3
eval.c
View file

@ -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));
}