Forum: Ruby-core [ruby-trunk - Bug #7630][Open] Proc/block doesn't take keyword arguments

Posted by ktsj (Kazuki Tsujimoto) (Guest)
on 2012-12-28 12:48
(Received via mailing list)
Issue #7630 has been reported by ktsj (Kazuki Tsujimoto).

----------------------------------------
Bug #7630: Proc/block doesn't take keyword arguments
https://bugs.ruby-lang.org/issues/7630

Author: ktsj (Kazuki Tsujimoto)
Status: Open
Priority: Normal
Assignee:
Category:
Target version: 2.0.0
ruby -v: ruby 2.0.0dev (2012-12-28 trunk 38642) [x86_64-linux]


=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
Posted by Nobuyoshi Nakada (nobu)
on 2012-12-29 13:59
(Received via mailing list)
Issue #7630 has been updated by nobu (Nobuyoshi Nakada).

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.
----------------------------------------
Bug #7630: Proc/block doesn't take keyword arguments
https://bugs.ruby-lang.org/issues/7630#change-35139

Author: ktsj (Kazuki Tsujimoto)
Status: Assigned
Priority: Normal
Assignee: ktsj (Kazuki Tsujimoto)
Category: core
Target version: 2.0.0
ruby -v: ruby 2.0.0dev (2012-12-28 trunk 38642) [x86_64-linux]


=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
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.