Bug #7630
closedProc/block doesn't take keyword arguments
Description
=begin
$ ./ruby -e 'Proc.new{|k: 0|}.()'
-e:1:in block in <main>': undefined method
key?' for 70368666077121:Fixnum (NoMethodError)
$ ./ruby -e '
def m
yield
end
m{|k: 0|}
'
-e:5:in block in <main>': undefined method
key?' for nil:NilClass (NoMethodError)
$ ./ruby -e 'lambda{|k: 0|}.()'
I think Proc/block should take keyword arguments as well as lambda.
I've attached a patch.
=end
Files
Updated by nobu (Nobuyoshi Nakada) almost 12 years ago
- Category set to core
- Status changed from Open to Assigned
- Assignee set to ktsj (Kazuki Tsujimoto)
It seems accessing out of the stack, so I think this bug is critical.
Please fix it with a test.
Updated by ktsj (Kazuki Tsujimoto) almost 12 years ago
- Status changed from Assigned to Closed
- % Done changed from 0 to 100
This issue was solved with changeset r38657.
Kazuki, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
-
vm_insnhelper.c: set keyword hash on Proc/block calls.
[ruby-core:51172] [Bug #7630] -
test/ruby/test_keyword.rb: add tests for above.