diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | parse.y | 2 | ||||
-rw-r--r-- | test/ruby/test_module.rb | 2 |
3 files changed, 8 insertions, 1 deletions
@@ -1,3 +1,8 @@ +Sat Jul 23 12:12:25 2011 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * parse.y (rb_check_id): conversion condition was inverse. + [Bug #5084] + Fri Jul 22 21:46:54 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com> * vm_insnhelper.c (vm_call_cfunc): added volatile for a workaround @@ -10111,7 +10111,7 @@ rb_check_id(VALUE name) if (SYMBOL_P(name)) { return SYM2ID(name); } - else if (RB_TYPE_P(name, T_STRING)) { + else if (!RB_TYPE_P(name, T_STRING)) { tmp = rb_check_string_type(name); if (NIL_P(tmp)) { tmp = rb_inspect(name); diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb index 1aa7f8c691..b6e827a944 100644 --- a/test/ruby/test_module.rb +++ b/test/ruby/test_module.rb @@ -498,6 +498,8 @@ class TestModule < Test::Unit::TestCase name = "gadzooks" assert !Symbol.all_symbols.any? {|sym| sym.to_s == name} assert_raise(NameError) { c1.const_defined?(name) } + bug5084 = '[ruby-dev:44200]' + assert_raise(TypeError, bug5084) { c1.const_defined?(1) } end def test_const_get_no_inherited |