From 2110125b43fca50e532c27a009362009f8522663 Mon Sep 17 00:00:00 2001 From: naruse Date: Tue, 29 Mar 2016 12:11:41 +0000 Subject: merge revision(s) 53485: [Backport #11976] * symbol.h (is_attrset_id): ASET is an attrset ID. fix unexpected safe call instead of an ordinary ASET. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@54396 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_call.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_call.rb b/test/ruby/test_call.rb index 7ef8d06936..fb79eadb64 100644 --- a/test/ruby/test_call.rb +++ b/test/ruby/test_call.rb @@ -83,4 +83,11 @@ class TestCall < Test::Unit::TestCase def test_safe_call_block_call_command assert_nil(("a".sub! "b" do end&.foo 1 do end)) end + + def test_invalid_safe_call + h = nil + assert_raise(NoMethodError) { + h[:foo] = nil + } + end end -- cgit v1.2.3