summaryrefslogtreecommitdiff
path: root/class.c
diff options
context:
space:
mode:
Diffstat (limited to 'class.c')
-rw-r--r--class.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/class.c b/class.c
index f8407ca77b..351f7aeb32 100644
--- a/class.c
+++ b/class.c
@@ -97,6 +97,9 @@ rb_check_inheritable(VALUE super)
if (RBASIC(super)->flags & FL_SINGLETON) {
rb_raise(rb_eTypeError, "can't make subclass of singleton class");
}
+ if (super == rb_cClass) {
+ rb_raise(rb_eTypeError, "can't make subclass of Class");
+ }
}
@@ -111,9 +114,6 @@ rb_class_new(VALUE super)
{
Check_Type(super, T_CLASS);
rb_check_inheritable(super);
- if (super == rb_cClass) {
- rb_raise(rb_eTypeError, "can't make subclass of Class");
- }
return rb_class_boot(super);
}