From: "nagachika (Tomoyuki Chikanaga) via ruby-core" Date: 2025-03-08T09:21:57+00:00 Subject: [ruby-core:121269] [Ruby master Bug#21112] Typo in error message when an incorrect key is used with WeakKeyMap Issue #21112 has been updated by nagachika (Tomoyuki Chikanaga). Backport changed from 3.1: DONTNEED, 3.2: DONTNEED, 3.3: REQUIRED, 3.4: DONE to 3.1: DONTNEED, 3.2: DONTNEED, 3.3: DONE, 3.4: DONE ruby_3_3 commit:e860cb2267cd17aef9a5e8e977d03410c213d6a2 merged revision(s) commit:91a10c07579f282a94e4b5830feaeca87f9a7dd3. ---------------------------------------- Bug #21112: Typo in error message when an incorrect key is used with WeakKeyMap https://bugs.ruby-lang.org/issues/21112#change-112225 * Author: andrykonchin (Andrew Konchin) * Status: Closed * ruby -v: 3.4.1 * Backport: 3.1: DONTNEED, 3.2: DONTNEED, 3.3: DONE, 3.4: DONE ---------------------------------------- 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/