
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/