* [ruby-core:120878] [Ruby master Bug#21112] Type in error message when an incorrect key is used with WeakKeyMap
@ 2025-02-04 19:18 andrykonchin (Andrew Konchin) via ruby-core
0 siblings, 0 replies; only message in thread
From: andrykonchin (Andrew Konchin) via ruby-core @ 2025-02-04 19:18 UTC (permalink / raw)
To: ruby-core; +Cc: andrykonchin (Andrew Konchin)
Issue #21112 has been reported by andrykonchin (Andrew Konchin).
----------------------------------------
Bug #21112: Type in error message when an incorrect key is used with WeakKeyMap
https://bugs.ruby-lang.org/issues/21112
* Author: andrykonchin (Andrew Konchin)
* Status: Open
* ruby -v: 3.4.1
* Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN
----------------------------------------
The `ObjectSpace::WeakKeyMap#[]=` method raises exception when key is either Symbol, Numeric or true/false/nil but error message looks like a bit incorrect:
```ruby
m = ObjectSpace::WeakKeyMap.new
m[:a] = 1
# 'ObjectSpace::WeakKeyMap#[]=': WeakKeyMap must be garbage collectable (ArgumentError)
```
The error message `WeakKeyMap must be garbage collectable` looks like should be `WeakKeyMap key must be garbage collectable`.
--
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/lists/ruby-core.ml.ruby-lang.org/
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-02-04 19:19 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-02-04 19:18 [ruby-core:120878] [Ruby master Bug#21112] Type in error message when an incorrect key is used with WeakKeyMap andrykonchin (Andrew Konchin) via ruby-core
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).