ruby-changes:49274
From: nobu <ko1@a...>
Date: Thu, 21 Dec 2017 20:59:36 +0900 (JST)
Subject: [ruby-changes:49274] nobu:r61391 (trunk): test for [Bug #14214]
nobu 2017-12-21 20:59:31 +0900 (Thu, 21 Dec 2017) New Revision: 61391 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=61391 Log: test for [Bug #14214] Modified files: trunk/test/ruby/test_optimization.rb Index: test/ruby/test_optimization.rb =================================================================== --- test/ruby/test_optimization.rb (revision 61390) +++ test/ruby/test_optimization.rb (revision 61391) @@ -708,4 +708,14 @@ class TestRubyOptimization < Test::Unit: https://github.com/ruby/ruby/blob/trunk/test/ruby/test_optimization.rb#L708 eval("{**(bug = nil; {})};42") assert_nil(bug) end + + def test_overwritten_blockparam + obj = Object.new + def obj.a(&block) + block = 1 + return :ok if block + :ng + end + assert_equal(:ok, obj.a()) + end end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/