diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | class.c | 2 | ||||
-rw-r--r-- | vm.c | 2 |
3 files changed, 8 insertions, 2 deletions
@@ -1,3 +1,9 @@ +Thu Aug 23 20:34:32 2012 NAKAMURA Usaku <usa@ruby-lang.org> + + * class.c (singleton_class_of): flonum can't have singleton class. + + * vm.c (vm_define_method): flonum can't have singleton method. + Thu Aug 23 19:18:33 2012 NAKAMURA Usaku <usa@ruby-lang.org> * common.mk (win32/*): macro RUBY_H_INCLUDES is not defined there, @@ -1315,7 +1315,7 @@ singleton_class_of(VALUE obj) { VALUE klass; - if (FIXNUM_P(obj) || SYMBOL_P(obj)) { + if (FIXNUM_P(obj) || FLONUM_P(obj) || SYMBOL_P(obj)) { rb_raise(rb_eTypeError, "can't define singleton"); } if (SPECIAL_CONST_P(obj)) { @@ -1857,7 +1857,7 @@ vm_define_method(rb_thread_t *th, VALUE obj, ID id, VALUE iseqval, } if (is_singleton) { - if (FIXNUM_P(obj) || SYMBOL_P(obj)) { + if (FIXNUM_P(obj) || FLONUM_P(obj) || SYMBOL_P(obj)) { rb_raise(rb_eTypeError, "can't define singleton method \"%s\" for %s", rb_id2name(id), rb_obj_classname(obj)); |