Commit d979172b authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto

Merge pull request #2784 from cremno/fix-splat-without-assignment

fix splat without assignment
parents 4bafd628 2aa59393
......@@ -964,6 +964,9 @@ gen_assignment(codegen_scope *s, node *tree, int sp, int val)
genop_peep(s, MKOP_AB(OP_MOVE, cursp(), sp), val);
}
break;
/* splat without assignment */
case NODE_NIL:
break;
default:
#ifdef ENABLE_STDIO
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment