From ac6747a9c52e22b5ceee81646083df68a33d3442 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Mon, 21 Apr 2014 14:55:06 +0900 Subject: fix optional block arguments in rhs define optional block arguments as argument variables in the rhs default expressions, as same as mere assignment expressions. Import ruby/ruby@01740f0c273c89f7bcff3d5014d73c8ff6fb1986 --- test/t/syntax.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test') diff --git a/test/t/syntax.rb b/test/t/syntax.rb index 245c5c099..83243a99f 100644 --- a/test/t/syntax.rb +++ b/test/t/syntax.rb @@ -289,3 +289,7 @@ assert('optional argument in the rhs default expressions') do assert_nil(o.t) assert_equal("method called", o.t2) end + +assert('optional block argument in the rhs default expressions') do + assert_nil(proc {|foo = foo| foo}.call) +end -- cgit v1.2.3