[#78633] ruby/spec needs help from CRuby committers — Benoit Daloze <eregontp@...>
Currently, ruby/spec is maintained mostly by individuals and enjoys the
13 messages
2016/12/13
[#78963] Re: ruby/spec needs help from CRuby committers
— Urabe Shyouhei <shyouhei@...>
2017/01/04
I did ask attendees of last developer meeting to join this
[#78642] Re: ruby/spec needs help from CRuby committers
— Eric Wong <normalperson@...>
2016/12/14
Benoit Daloze <eregontp@gmail.com> wrote:
[ruby-core:78783] [Ruby trunk Bug#12855] Inconsistent keys identity in compare_by_identity Hash when using literals
From:
shyouhei@...
Date:
2016-12-21 14:48:34 UTC
List:
ruby-core #78783
Issue #12855 has been updated by Shyouhei Urabe.
Assignee changed from Eric Wong to Aman Gupta
We looked at this issue at today's developer meeting. It seems over-optimization as Benoit originally guessed. Let me assign this to Aman.
----------------------------------------
Bug #12855: Inconsistent keys identity in compare_by_identity Hash when using literals
https://bugs.ruby-lang.org/issues/12855#change-62190
* Author: Benoit Daloze
* Status: Assigned
* Priority: Normal
* Assignee: Aman Gupta
* Target version:
* ruby -v: ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux]
* Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
----------------------------------------
This seems a regression since 2.2.
I would guess it's due to some optimization for having a string literal between []=.
That optimization should not trigger for compare_by_identity hashes, so both cases below are consistent.
~~~ruby
h = {}.compare_by_identity
h['pear'] = 1
h['pear'] = 2
p h.size # => 1
p h
h = {}.compare_by_identity
k1 = 'pear'
h[k1] = 1
k2 = 'pear'
h[k2] = 2
p h.size # => 2
p h
~~~
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>