mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
* class.c (rb_class_init_copy): singleton class is disallowed to copy,
from its definition. fixed: [ruby-talk:142749] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8469 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
73cc4a2cd7
commit
297cb521c1
2 changed files with 7 additions and 1 deletions
3
class.c
3
class.c
|
@ -92,6 +92,9 @@ rb_class_init_copy(clone, orig)
|
|||
if (RCLASS(clone)->super != 0) {
|
||||
rb_raise(rb_eTypeError, "already initialized class");
|
||||
}
|
||||
if (FL_TEST(orig, FL_SINGLETON)) {
|
||||
rb_raise(rb_eTypeError, "can't copy singleton class");
|
||||
}
|
||||
return rb_mod_init_copy(clone, orig);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue