Project

General

Profile

Actions

Bug #5730

closed

Optinal block parameters assigns wrong

Added by matz (Yukihiro Matsumoto) almost 13 years ago. Updated almost 13 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
-
Backport:
[ruby-core:41557]

Description

The following program do not expand the given array, but it should expand the value.

def foo(&block)
block.call([1,2])
end
h = foo{|k=6,v=8|
p [k,v] # gives [[1,2],8] but should be [1,2]
}


Files

noname (500 Bytes) noname Anonymous, 12/09/2011 09:29 AM

Related issues 1 (0 open1 closed)

Related to Ruby master - Bug #7621: ブロック引数にデフォルト値を指定したときに配列を渡した際の挙動が1.9.3と変わっているClosed12/25/2012Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0