mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 16:44:01 +02:00
* compile.c (iseq_compile_each): fix return value of obj[a,*b]=c.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32146 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
becd789625
commit
021f166509
3 changed files with 19 additions and 0 deletions
|
@ -402,6 +402,10 @@ m(1,2,*ary,&b)
|
|||
$result
|
||||
}
|
||||
|
||||
# aset and splat
|
||||
assert_equal '4', %q{class Foo;def []=(a,b,c,d);end;end;Foo.new[1,*a=[2,3]]=4}
|
||||
assert_equal '4', %q{class Foo;def []=(a,b,c,d);end;end;def m(&blk)Foo.new[1,*a=[2,3],&blk]=4;end;m{}}
|
||||
|
||||
# post test
|
||||
assert_equal %q{[1, 2, :o1, :o2, [], 3, 4, NilClass, nil, nil]}, %q{
|
||||
def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2, &b)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue