From 2aa59393bafa24421ff6c5b90de59af8a25f927c Mon Sep 17 00:00:00 2001 From: cremno Date: Thu, 7 May 2015 16:58:43 +0200 Subject: fix splat without assignment; fix #2781 The parser generates NODE_NIL for tSTAR without argument in masgns. The codegen didn't handle that. --- test/t/syntax.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/t/syntax.rb') diff --git a/test/t/syntax.rb b/test/t/syntax.rb index d21748de1..5ce4e0a63 100644 --- a/test/t/syntax.rb +++ b/test/t/syntax.rb @@ -213,6 +213,12 @@ assert('Splat and multiple assignment in for') do assert_equal 7, f end +assert('Splat without assignment') do + * = [0] + a, * = [1, 2] + assert_equal 1, a +end + assert('Return values of case statements') do a = [] << case 1 when 3 then 2 -- cgit v1.2.3