* [ruby-core:68728] [Ruby trunk - Bug #11027] [Open] Named Argument assignment from Hash failure
[not found] <redmine.issue-11027.20150402224720@ruby-lang.org>
@ 2015-04-02 22:47 ` alangano
2015-04-02 22:52 ` [ruby-core:68729] [Ruby trunk - Bug #11027] " alangano
` (5 subsequent siblings)
6 siblings, 0 replies; 7+ messages in thread
From: alangano @ 2015-04-02 22:47 UTC (permalink / raw
To: ruby-core
Issue #11027 has been reported by Alan Gano.
----------------------------------------
Bug #11027: Named Argument assignment from Hash failure
https://bugs.ruby-lang.org/issues/11027
* Author: Alan Gano
* Status: Open
* Priority: Normal
* Assignee:
* ruby -v: ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
I am call a method, which has named arguments, a Hash, which then as expected, maps the keys of the Hash to the argument names.
I boiled down a problem scenario wherein it fails to do this. In the code below the argument i_field2 of the ack() method, is failing to be set from the Hash. It gets set to nil.
This also occurs in 2.2.0p0.
---------------------------------------------------------
require 'base64'
def ack(i_field1:,i_field2:,**i_others)
puts '-'*79
puts i_field1.inspect
puts ">>> #{i_field2.inspect} <<< SHOULD be 'field2'"
puts i_others.inspect
end
# create the marshaled hash in another execution
#t_args = {i_field1:"field1",i_field2:"field2",something:"something"}
#puts Base64.strict_encode64(Marshal.dump(t_args))
#exit
t_marshal = 'BAh7CDoNaV9maWVsZDFJIgtmaWVsZDEGOgZFVDoNaV9maWVsZDJJIgtmaWVsZDIGOwZUOg5zb21ldGhpbmdJIg5zb21ldGhpbmcGOwZU'
t_args = Marshal.load(Base64.strict_decode64(t_marshal))
puts t_args.inspect
# => {:i_field1=>"field1", :i_field2=>"field2", :something=>"something"}
ack(t_args)
#_ = { something:'?' } # makes it work
#_ = { :something => '?' } # makes it work
#_ = :something # makes it work
---------------------------------------------------------
--
https://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 7+ messages in thread
* [ruby-core:68729] [Ruby trunk - Bug #11027] Named Argument assignment from Hash failure
[not found] <redmine.issue-11027.20150402224720@ruby-lang.org>
2015-04-02 22:47 ` [ruby-core:68728] [Ruby trunk - Bug #11027] [Open] Named Argument assignment from Hash failure alangano
@ 2015-04-02 22:52 ` alangano
2015-04-03 3:20 ` [ruby-core:68732] " nobu
` (4 subsequent siblings)
6 siblings, 0 replies; 7+ messages in thread
From: alangano @ 2015-04-02 22:52 UTC (permalink / raw
To: ruby-core
Issue #11027 has been updated by Alan Gano.
Formatting fix ...
~~~
require 'base64'
def ack(i_field1:,i_field2:,**i_others)
puts '-'*79
puts i_field1.inspect
puts ">>> #{i_field2.inspect} <<< SHOULD be 'field2'"
puts i_others.inspect
end
# create the marshaled hash in another execution
#t_args = {i_field1:"field1",i_field2:"field2",something:"something"}
#puts Base64.strict_encode64(Marshal.dump(t_args))
#exit
t_marshal = 'BAh7CDoNaV9maWVsZDFJIgtmaWVsZDEGOgZFVDoNaV9maWVsZDJJIgtmaWVsZDIGOwZUOg5zb21ldGhpbmdJIg5zb21ldGhpbmcGOwZU'
t_args = Marshal.load(Base64.strict_decode64(t_marshal))
puts t_args.inspect
# => {:i_field1=>"field1", :i_field2=>"field2", :something=>"something"}
ack(t_args)
#_ = { something:'?' } # makes it work
#_ = { :something => '?' } # makes it work
#_ = :something # makes it work
~~~
----------------------------------------
Bug #11027: Named Argument assignment from Hash failure
https://bugs.ruby-lang.org/issues/11027#change-52012
* Author: Alan Gano
* Status: Open
* Priority: Normal
* Assignee:
* ruby -v: ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
I am call a method, which has named arguments, a Hash, which then as expected, maps the keys of the Hash to the argument names.
I boiled down a problem scenario wherein it fails to do this. In the code below the argument i_field2 of the ack() method, is failing to be set from the Hash. It gets set to nil.
This also occurs in 2.2.0p0.
---------------------------------------------------------
require 'base64'
def ack(i_field1:,i_field2:,**i_others)
puts '-'*79
puts i_field1.inspect
puts ">>> #{i_field2.inspect} <<< SHOULD be 'field2'"
puts i_others.inspect
end
# create the marshaled hash in another execution
#t_args = {i_field1:"field1",i_field2:"field2",something:"something"}
#puts Base64.strict_encode64(Marshal.dump(t_args))
#exit
t_marshal = 'BAh7CDoNaV9maWVsZDFJIgtmaWVsZDEGOgZFVDoNaV9maWVsZDJJIgtmaWVsZDIGOwZUOg5zb21ldGhpbmdJIg5zb21ldGhpbmcGOwZU'
t_args = Marshal.load(Base64.strict_decode64(t_marshal))
puts t_args.inspect
# => {:i_field1=>"field1", :i_field2=>"field2", :something=>"something"}
ack(t_args)
#_ = { something:'?' } # makes it work
#_ = { :something => '?' } # makes it work
#_ = :something # makes it work
---------------------------------------------------------
--
https://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 7+ messages in thread
* [ruby-core:68732] [Ruby trunk - Bug #11027] Named Argument assignment from Hash failure
[not found] <redmine.issue-11027.20150402224720@ruby-lang.org>
2015-04-02 22:47 ` [ruby-core:68728] [Ruby trunk - Bug #11027] [Open] Named Argument assignment from Hash failure alangano
2015-04-02 22:52 ` [ruby-core:68729] [Ruby trunk - Bug #11027] " alangano
@ 2015-04-03 3:20 ` nobu
2015-04-03 4:46 ` [ruby-core:68736] [Ruby trunk - Bug #11027] [Assigned] " nobu
` (3 subsequent siblings)
6 siblings, 0 replies; 7+ messages in thread
From: nobu @ 2015-04-03 3:20 UTC (permalink / raw
To: ruby-core
Issue #11027 has been updated by Nobuyoshi Nakada.
Description updated
Marshal is not mandatory.
It can reproduce with a dynamic symbol keyword argument.
~~~ruby
ack(i_field1:"field1", i_field2:"field2", "something".intern=>"something")
~~~
----------------------------------------
Bug #11027: Named Argument assignment from Hash failure
https://bugs.ruby-lang.org/issues/11027#change-52018
* Author: Alan Gano
* Status: Open
* Priority: Normal
* Assignee:
* ruby -v: ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
I am call a method, which has named arguments, a Hash, which then as expected, maps the keys of the Hash to the argument names.
I boiled down a problem scenario wherein it fails to do this. In the code below the argument i_field2 of the ack() method, is failing to be set from the Hash. It gets set to nil.
This also occurs in 2.2.0p0.
~~~ruby
require 'base64'
def ack(i_field1:,i_field2:,**i_others)
puts '-'*79
puts i_field1.inspect
puts ">>> #{i_field2.inspect} <<< SHOULD be 'field2'"
puts i_others.inspect
end
# create the marshaled hash in another execution
#t_args = {i_field1:"field1",i_field2:"field2",something:"something"}
#puts Base64.strict_encode64(Marshal.dump(t_args))
#exit
t_marshal = 'BAh7CDoNaV9maWVsZDFJIgtmaWVsZDEGOgZFVDoNaV9maWVsZDJJIgtmaWVsZDIGOwZUOg5zb21ldGhpbmdJIg5zb21ldGhpbmcGOwZU'
t_args = Marshal.load(Base64.strict_decode64(t_marshal))
puts t_args.inspect
# => {:i_field1=>"field1", :i_field2=>"field2", :something=>"something"}
ack(t_args)
#_ = { something:'?' } # makes it work
#_ = { :something => '?' } # makes it work
#_ = :something # makes it work
~~~
--
https://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 7+ messages in thread
* [ruby-core:68736] [Ruby trunk - Bug #11027] [Assigned] Named Argument assignment from Hash failure
[not found] <redmine.issue-11027.20150402224720@ruby-lang.org>
` (2 preceding siblings ...)
2015-04-03 3:20 ` [ruby-core:68732] " nobu
@ 2015-04-03 4:46 ` nobu
2015-04-06 7:14 ` [ruby-core:68766] [Ruby trunk - Bug #11027] " ko1
` (2 subsequent siblings)
6 siblings, 0 replies; 7+ messages in thread
From: nobu @ 2015-04-03 4:46 UTC (permalink / raw
To: ruby-core
Issue #11027 has been updated by Nobuyoshi Nakada.
Status changed from Open to Assigned
Assignee set to Koichi Sasada
Ko1 is going to fix this issue by advancing `sp` prior to arguments setup instead of `mark_stack_len`.
----------------------------------------
Bug #11027: Named Argument assignment from Hash failure
https://bugs.ruby-lang.org/issues/11027#change-52021
* Author: Alan Gano
* Status: Assigned
* Priority: Normal
* Assignee: Koichi Sasada
* ruby -v: ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
I am call a method, which has named arguments, a Hash, which then as expected, maps the keys of the Hash to the argument names.
I boiled down a problem scenario wherein it fails to do this. In the code below the argument i_field2 of the ack() method, is failing to be set from the Hash. It gets set to nil.
This also occurs in 2.2.0p0.
~~~ruby
require 'base64'
def ack(i_field1:,i_field2:,**i_others)
puts '-'*79
puts i_field1.inspect
puts ">>> #{i_field2.inspect} <<< SHOULD be 'field2'"
puts i_others.inspect
end
# create the marshaled hash in another execution
#t_args = {i_field1:"field1",i_field2:"field2",something:"something"}
#puts Base64.strict_encode64(Marshal.dump(t_args))
#exit
t_marshal = 'BAh7CDoNaV9maWVsZDFJIgtmaWVsZDEGOgZFVDoNaV9maWVsZDJJIgtmaWVsZDIGOwZUOg5zb21ldGhpbmdJIg5zb21ldGhpbmcGOwZU'
t_args = Marshal.load(Base64.strict_decode64(t_marshal))
puts t_args.inspect
# => {:i_field1=>"field1", :i_field2=>"field2", :something=>"something"}
ack(t_args)
#_ = { something:'?' } # makes it work
#_ = { :something => '?' } # makes it work
#_ = :something # makes it work
~~~
--
https://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 7+ messages in thread
* [ruby-core:68766] [Ruby trunk - Bug #11027] Named Argument assignment from Hash failure
[not found] <redmine.issue-11027.20150402224720@ruby-lang.org>
` (3 preceding siblings ...)
2015-04-03 4:46 ` [ruby-core:68736] [Ruby trunk - Bug #11027] [Assigned] " nobu
@ 2015-04-06 7:14 ` ko1
2015-04-24 6:18 ` [ruby-core:68979] " nobu
2015-05-20 16:05 ` [ruby-core:69250] " nagachika00
6 siblings, 0 replies; 7+ messages in thread
From: ko1 @ 2015-04-06 7:14 UTC (permalink / raw
To: ruby-core
Issue #11027 has been updated by Koichi Sasada.
Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN to 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: REQUIRED
----------------------------------------
Bug #11027: Named Argument assignment from Hash failure
https://bugs.ruby-lang.org/issues/11027#change-52048
* Author: Alan Gano
* Status: Assigned
* Priority: Normal
* Assignee: Koichi Sasada
* ruby -v: ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: REQUIRED
----------------------------------------
I am call a method, which has named arguments, a Hash, which then as expected, maps the keys of the Hash to the argument names.
I boiled down a problem scenario wherein it fails to do this. In the code below the argument i_field2 of the ack() method, is failing to be set from the Hash. It gets set to nil.
This also occurs in 2.2.0p0.
~~~ruby
require 'base64'
def ack(i_field1:,i_field2:,**i_others)
puts '-'*79
puts i_field1.inspect
puts ">>> #{i_field2.inspect} <<< SHOULD be 'field2'"
puts i_others.inspect
end
# create the marshaled hash in another execution
#t_args = {i_field1:"field1",i_field2:"field2",something:"something"}
#puts Base64.strict_encode64(Marshal.dump(t_args))
#exit
t_marshal = 'BAh7CDoNaV9maWVsZDFJIgtmaWVsZDEGOgZFVDoNaV9maWVsZDJJIgtmaWVsZDIGOwZUOg5zb21ldGhpbmdJIg5zb21ldGhpbmcGOwZU'
t_args = Marshal.load(Base64.strict_decode64(t_marshal))
puts t_args.inspect
# => {:i_field1=>"field1", :i_field2=>"field2", :something=>"something"}
ack(t_args)
#_ = { something:'?' } # makes it work
#_ = { :something => '?' } # makes it work
#_ = :something # makes it work
~~~
--
https://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 7+ messages in thread
* [ruby-core:68979] [Ruby trunk - Bug #11027] Named Argument assignment from Hash failure
[not found] <redmine.issue-11027.20150402224720@ruby-lang.org>
` (4 preceding siblings ...)
2015-04-06 7:14 ` [ruby-core:68766] [Ruby trunk - Bug #11027] " ko1
@ 2015-04-24 6:18 ` nobu
2015-05-20 16:05 ` [ruby-core:69250] " nagachika00
6 siblings, 0 replies; 7+ messages in thread
From: nobu @ 2015-04-24 6:18 UTC (permalink / raw
To: ruby-core
Issue #11027 has been updated by Nobuyoshi Nakada.
Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: REQUIRED to 2.0.0: DONTNEED, 2.1: DONTNEED, 2.2: REQUIRED
----------------------------------------
Bug #11027: Named Argument assignment from Hash failure
https://bugs.ruby-lang.org/issues/11027#change-52233
* Author: Alan Gano
* Status: Closed
* Priority: Normal
* Assignee: Koichi Sasada
* ruby -v: ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux]
* Backport: 2.0.0: DONTNEED, 2.1: DONTNEED, 2.2: REQUIRED
----------------------------------------
I am call a method, which has named arguments, a Hash, which then as expected, maps the keys of the Hash to the argument names.
I boiled down a problem scenario wherein it fails to do this. In the code below the argument i_field2 of the ack() method, is failing to be set from the Hash. It gets set to nil.
This also occurs in 2.2.0p0.
~~~ruby
require 'base64'
def ack(i_field1:,i_field2:,**i_others)
puts '-'*79
puts i_field1.inspect
puts ">>> #{i_field2.inspect} <<< SHOULD be 'field2'"
puts i_others.inspect
end
# create the marshaled hash in another execution
#t_args = {i_field1:"field1",i_field2:"field2",something:"something"}
#puts Base64.strict_encode64(Marshal.dump(t_args))
#exit
t_marshal = 'BAh7CDoNaV9maWVsZDFJIgtmaWVsZDEGOgZFVDoNaV9maWVsZDJJIgtmaWVsZDIGOwZUOg5zb21ldGhpbmdJIg5zb21ldGhpbmcGOwZU'
t_args = Marshal.load(Base64.strict_decode64(t_marshal))
puts t_args.inspect
# => {:i_field1=>"field1", :i_field2=>"field2", :something=>"something"}
ack(t_args)
#_ = { something:'?' } # makes it work
#_ = { :something => '?' } # makes it work
#_ = :something # makes it work
~~~
--
https://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 7+ messages in thread
* [ruby-core:69250] [Ruby trunk - Bug #11027] Named Argument assignment from Hash failure
[not found] <redmine.issue-11027.20150402224720@ruby-lang.org>
` (5 preceding siblings ...)
2015-04-24 6:18 ` [ruby-core:68979] " nobu
@ 2015-05-20 16:05 ` nagachika00
6 siblings, 0 replies; 7+ messages in thread
From: nagachika00 @ 2015-05-20 16:05 UTC (permalink / raw
To: ruby-core
Issue #11027 has been updated by Tomoyuki Chikanaga.
Backport changed from 2.0.0: DONTNEED, 2.1: DONTNEED, 2.2: REQUIRED to 2.0.0: DONTNEED, 2.1: DONTNEED, 2.2: DONE
Backorted into `ruby_2_2` branch at r50562.
----------------------------------------
Bug #11027: Named Argument assignment from Hash failure
https://bugs.ruby-lang.org/issues/11027#change-52503
* Author: Alan Gano
* Status: Closed
* Priority: Normal
* Assignee: Koichi Sasada
* ruby -v: ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux]
* Backport: 2.0.0: DONTNEED, 2.1: DONTNEED, 2.2: DONE
----------------------------------------
I am call a method, which has named arguments, a Hash, which then as expected, maps the keys of the Hash to the argument names.
I boiled down a problem scenario wherein it fails to do this. In the code below the argument i_field2 of the ack() method, is failing to be set from the Hash. It gets set to nil.
This also occurs in 2.2.0p0.
~~~ruby
require 'base64'
def ack(i_field1:,i_field2:,**i_others)
puts '-'*79
puts i_field1.inspect
puts ">>> #{i_field2.inspect} <<< SHOULD be 'field2'"
puts i_others.inspect
end
# create the marshaled hash in another execution
#t_args = {i_field1:"field1",i_field2:"field2",something:"something"}
#puts Base64.strict_encode64(Marshal.dump(t_args))
#exit
t_marshal = 'BAh7CDoNaV9maWVsZDFJIgtmaWVsZDEGOgZFVDoNaV9maWVsZDJJIgtmaWVsZDIGOwZUOg5zb21ldGhpbmdJIg5zb21ldGhpbmcGOwZU'
t_args = Marshal.load(Base64.strict_decode64(t_marshal))
puts t_args.inspect
# => {:i_field1=>"field1", :i_field2=>"field2", :something=>"something"}
ack(t_args)
#_ = { something:'?' } # makes it work
#_ = { :something => '?' } # makes it work
#_ = :something # makes it work
~~~
--
https://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2015-05-20 15:48 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <redmine.issue-11027.20150402224720@ruby-lang.org>
2015-04-02 22:47 ` [ruby-core:68728] [Ruby trunk - Bug #11027] [Open] Named Argument assignment from Hash failure alangano
2015-04-02 22:52 ` [ruby-core:68729] [Ruby trunk - Bug #11027] " alangano
2015-04-03 3:20 ` [ruby-core:68732] " nobu
2015-04-03 4:46 ` [ruby-core:68736] [Ruby trunk - Bug #11027] [Assigned] " nobu
2015-04-06 7:14 ` [ruby-core:68766] [Ruby trunk - Bug #11027] " ko1
2015-04-24 6:18 ` [ruby-core:68979] " nobu
2015-05-20 16:05 ` [ruby-core:69250] " nagachika00
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).