ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:63593] [ruby-trunk - Bug #10016] [Open] Destructuring block arguments with a Hashable last element
       [not found] <redmine.issue-10016.20140708215549@ruby-lang.org>
@ 2014-07-08 21:55 ` brixen
  2014-07-09 11:31 ` [ruby-core:63600] [ruby-trunk - Bug #10016] " nobu
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 5+ messages in thread
From: brixen @ 2014-07-08 21:55 UTC (permalink / raw
  To: ruby-core

Issue #10016 has been reported by Brian Shirai.

----------------------------------------
Bug #10016: Destructuring block arguments with a Hashable last element
https://bugs.ruby-lang.org/issues/10016

* Author: Brian Shirai
* Status: Open
* Priority: Normal
* Assignee: 
* Category: 
* Target version: 
* ruby -v: ruby 2.2.0dev (2014-06-05 trunk 46353) [x86_64-darwin13]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN
----------------------------------------
The following code:

# destructure_bug.rb
def m
  x = Object.new
  def x.to_hash() {x: 9} end

  yield [1, 2, 3, x]
end

p m { |a, *b, c, **k| [a, b, c, k] }

gives:

$ ruby -v destructure_bug.rb
ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin13.0]
[#<Object:0x007fc5fb212870>, [nil], 1, {:x=>9}]

$ ruby -v destructure_bug.rb
ruby 2.2.0dev (2014-06-05 trunk 46353) [x86_64-darwin13]
[#<Object:0x007f88c206c2a8>, [nil], 1, {:x=>9}]

I would expect: [1, [2], 3, {:x=>9}]

Is this a bug?





-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ruby-core:63600] [ruby-trunk - Bug #10016] Destructuring block arguments with a Hashable last element
       [not found] <redmine.issue-10016.20140708215549@ruby-lang.org>
  2014-07-08 21:55 ` [ruby-core:63593] [ruby-trunk - Bug #10016] [Open] Destructuring block arguments with a Hashable last element brixen
@ 2014-07-09 11:31 ` nobu
  2014-07-10  6:03 ` [ruby-core:63619] [ruby-trunk - Bug #10016] [Closed] " nobu
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 5+ messages in thread
From: nobu @ 2014-07-09 11:31 UTC (permalink / raw
  To: ruby-core

Issue #10016 has been updated by Nobuyoshi Nakada.

Description updated
Category set to core
Target version set to current: 2.2.0
Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN to 2.0.0: REQUIRED, 2.1: REQUIRED

Elements expanded on the VM stack are overwritten by calling `to_hash` method.

----------------------------------------
Bug #10016: Destructuring block arguments with a Hashable last element
https://bugs.ruby-lang.org/issues/10016#change-47655

* Author: Brian Shirai
* Status: Open
* Priority: Normal
* Assignee: 
* Category: core
* Target version: current: 2.2.0
* ruby -v: ruby 2.2.0dev (2014-06-05 trunk 46353) [x86_64-darwin13]
* Backport: 2.0.0: REQUIRED, 2.1: REQUIRED
----------------------------------------
The following code:

~~~ruby
# destructure_bug.rb
def m
  x = Object.new
  def x.to_hash() {x: 9} end

  yield [1, 2, 3, x]
end

p m { |a, *b, c, **k| [a, b, c, k] }
~~~
gives:

~~~
$ ruby -v destructure_bug.rb
ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin13.0]
[#<Object:0x007fc5fb212870>, [nil], 1, {:x=>9}]

$ ruby -v destructure_bug.rb
ruby 2.2.0dev (2014-06-05 trunk 46353) [x86_64-darwin13]
[#<Object:0x007f88c206c2a8>, [nil], 1, {:x=>9}]
~~~

I would expect: `[1, [2], 3, {:x=>9}]`

Is this a bug?





-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ruby-core:63619] [ruby-trunk - Bug #10016] [Closed] Destructuring block arguments with a Hashable last element
       [not found] <redmine.issue-10016.20140708215549@ruby-lang.org>
  2014-07-08 21:55 ` [ruby-core:63593] [ruby-trunk - Bug #10016] [Open] Destructuring block arguments with a Hashable last element brixen
  2014-07-09 11:31 ` [ruby-core:63600] [ruby-trunk - Bug #10016] " nobu
@ 2014-07-10  6:03 ` nobu
  2014-08-11 13:22 ` [ruby-core:64299] [ruby-trunk - Bug #10016] " nagachika00
  2014-09-03  4:15 ` [ruby-core:64720] " usa
  4 siblings, 0 replies; 5+ messages in thread
From: nobu @ 2014-07-10  6:03 UTC (permalink / raw
  To: ruby-core

Issue #10016 has been updated by Nobuyoshi Nakada.

Status changed from Open to Closed
% Done changed from 0 to 100

Applied in changeset r46775.

----------
vm_insnhelper.c: fix implicit splat keyword argument

* vm_insnhelper.c (vm_callee_setup_keyword_arg): adjust VM stack
  pointer to get rid of overwriting splat arguments by arguments
  for `to_hash` conversion.  [ruby-core:63593] [Bug #10016]

----------------------------------------
Bug #10016: Destructuring block arguments with a Hashable last element
https://bugs.ruby-lang.org/issues/10016#change-47672

* Author: Brian Shirai
* Status: Closed
* Priority: Normal
* Assignee: 
* Category: core
* Target version: current: 2.2.0
* ruby -v: ruby 2.2.0dev (2014-06-05 trunk 46353) [x86_64-darwin13]
* Backport: 2.0.0: REQUIRED, 2.1: REQUIRED
----------------------------------------
The following code:

~~~ruby
# destructure_bug.rb
def m
  x = Object.new
  def x.to_hash() {x: 9} end

  yield [1, 2, 3, x]
end

p m { |a, *b, c, **k| [a, b, c, k] }
~~~
gives:

~~~
$ ruby -v destructure_bug.rb
ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin13.0]
[#<Object:0x007fc5fb212870>, [nil], 1, {:x=>9}]

$ ruby -v destructure_bug.rb
ruby 2.2.0dev (2014-06-05 trunk 46353) [x86_64-darwin13]
[#<Object:0x007f88c206c2a8>, [nil], 1, {:x=>9}]
~~~

I would expect: `[1, [2], 3, {:x=>9}]`

Is this a bug?





-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ruby-core:64299] [ruby-trunk - Bug #10016] Destructuring block arguments with a Hashable last element
       [not found] <redmine.issue-10016.20140708215549@ruby-lang.org>
                   ` (2 preceding siblings ...)
  2014-07-10  6:03 ` [ruby-core:63619] [ruby-trunk - Bug #10016] [Closed] " nobu
@ 2014-08-11 13:22 ` nagachika00
  2014-09-03  4:15 ` [ruby-core:64720] " usa
  4 siblings, 0 replies; 5+ messages in thread
From: nagachika00 @ 2014-08-11 13:22 UTC (permalink / raw
  To: ruby-core

Issue #10016 has been updated by Tomoyuki Chikanaga.

Backport changed from 2.0.0: REQUIRED, 2.1: REQUIRED to 2.0.0: REQUIRED, 2.1: DONE

Backported into `ruby_2_1` branch at r47138.

----------------------------------------
Bug #10016: Destructuring block arguments with a Hashable last element
https://bugs.ruby-lang.org/issues/10016#change-48281

* Author: Brian Shirai
* Status: Closed
* Priority: Normal
* Assignee: 
* Category: core
* Target version: current: 2.2.0
* ruby -v: ruby 2.2.0dev (2014-06-05 trunk 46353) [x86_64-darwin13]
* Backport: 2.0.0: REQUIRED, 2.1: DONE
----------------------------------------
The following code:

~~~ruby
# destructure_bug.rb
def m
  x = Object.new
  def x.to_hash() {x: 9} end

  yield [1, 2, 3, x]
end

p m { |a, *b, c, **k| [a, b, c, k] }
~~~
gives:

~~~
$ ruby -v destructure_bug.rb
ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin13.0]
[#<Object:0x007fc5fb212870>, [nil], 1, {:x=>9}]

$ ruby -v destructure_bug.rb
ruby 2.2.0dev (2014-06-05 trunk 46353) [x86_64-darwin13]
[#<Object:0x007f88c206c2a8>, [nil], 1, {:x=>9}]
~~~

I would expect: `[1, [2], 3, {:x=>9}]`

Is this a bug?





-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ruby-core:64720] [ruby-trunk - Bug #10016] Destructuring block arguments with a Hashable last element
       [not found] <redmine.issue-10016.20140708215549@ruby-lang.org>
                   ` (3 preceding siblings ...)
  2014-08-11 13:22 ` [ruby-core:64299] [ruby-trunk - Bug #10016] " nagachika00
@ 2014-09-03  4:15 ` usa
  4 siblings, 0 replies; 5+ messages in thread
From: usa @ 2014-09-03  4:15 UTC (permalink / raw
  To: ruby-core

Issue #10016 has been updated by Usaku NAKAMURA.

Backport changed from 2.0.0: REQUIRED, 2.1: DONE to 2.0.0: WONTFIX, 2.1: DONE

----------------------------------------
Bug #10016: Destructuring block arguments with a Hashable last element
https://bugs.ruby-lang.org/issues/10016#change-48616

* Author: Brian Shirai
* Status: Closed
* Priority: Normal
* Assignee: 
* Category: core
* Target version: current: 2.2.0
* ruby -v: ruby 2.2.0dev (2014-06-05 trunk 46353) [x86_64-darwin13]
* Backport: 2.0.0: WONTFIX, 2.1: DONE
----------------------------------------
The following code:

~~~ruby
# destructure_bug.rb
def m
  x = Object.new
  def x.to_hash() {x: 9} end

  yield [1, 2, 3, x]
end

p m { |a, *b, c, **k| [a, b, c, k] }
~~~
gives:

~~~
$ ruby -v destructure_bug.rb
ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin13.0]
[#<Object:0x007fc5fb212870>, [nil], 1, {:x=>9}]

$ ruby -v destructure_bug.rb
ruby 2.2.0dev (2014-06-05 trunk 46353) [x86_64-darwin13]
[#<Object:0x007f88c206c2a8>, [nil], 1, {:x=>9}]
~~~

I would expect: `[1, [2], 3, {:x=>9}]`

Is this a bug?





-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-09-03  4:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <redmine.issue-10016.20140708215549@ruby-lang.org>
2014-07-08 21:55 ` [ruby-core:63593] [ruby-trunk - Bug #10016] [Open] Destructuring block arguments with a Hashable last element brixen
2014-07-09 11:31 ` [ruby-core:63600] [ruby-trunk - Bug #10016] " nobu
2014-07-10  6:03 ` [ruby-core:63619] [ruby-trunk - Bug #10016] [Closed] " nobu
2014-08-11 13:22 ` [ruby-core:64299] [ruby-trunk - Bug #10016] " nagachika00
2014-09-03  4:15 ` [ruby-core:64720] " usa

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).