From: "nobu (Nobuyoshi Nakada) via ruby-core" <ruby-core@ml.ruby-lang.org>
To: ruby-core@ml.ruby-lang.org
Cc: "nobu (Nobuyoshi Nakada)" <noreply@ruby-lang.org>
Subject: [ruby-core:116965] [Ruby master Bug#20307] `Hash#update` from compare_by_identity hash can have unfrozen string keys
Date: Tue, 27 Feb 2024 03:33:35 +0000 (UTC) [thread overview]
Message-ID: <redmine.issue-20307.20240227033335.4@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-20307.20240227033335.4@ruby-lang.org
Issue #20307 has been reported by nobu (Nobuyoshi Nakada).
----------------------------------------
Bug #20307: `Hash#update` from compare_by_identity hash can have unfrozen string keys
https://bugs.ruby-lang.org/issues/20307
* Author: nobu (Nobuyoshi Nakada)
* Status: Open
* Backport: 3.0: REQUIRED, 3.1: REQUIRED, 3.2: REQUIRED, 3.3: REQUIRED
----------------------------------------
I don't think this behavior is expected.
```ruby
i = Hash.new.compare_by_identity
k = "a"
i[k] = 0
h = {}.update(i)
p h["a"] # => 0
k.upcase!
p h.fetch(k) # in 'Hash#fetch': key not found: "A" (KeyError)
```
--
https://bugs.ruby-lang.org/
______________________________________________
ruby-core mailing list -- ruby-core@ml.ruby-lang.org
To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/
next parent reply other threads:[~2024-02-27 3:33 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-27 3:33 nobu (Nobuyoshi Nakada) via ruby-core [this message]
2024-02-27 4:46 ` [ruby-core:116967] [Ruby master Bug#20307] `Hash#update` from compare_by_identity hash can have unfrozen string keys nobu (Nobuyoshi Nakada) via ruby-core
2024-03-03 15:17 ` [ruby-core:117043] " Dan0042 (Daniel DeLorme) via ruby-core
2024-03-03 16:15 ` [ruby-core:117044] " byroot (Jean Boussier) via ruby-core
2024-03-03 16:18 ` [ruby-core:117045] " byroot (Jean Boussier) via ruby-core
2024-05-28 23:43 ` [ruby-core:118051] " k0kubun (Takashi Kokubun) via ruby-core
2024-07-13 7:35 ` [ruby-core:118587] " nagachika (Tomoyuki Chikanaga) via ruby-core
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=redmine.issue-20307.20240227033335.4@ruby-lang.org \
--to=ruby-core@ml.ruby-lang.org \
--cc=noreply@ruby-lang.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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 NNTP newsgroup(s).