Project

General

Profile

Actions

Bug #21112

closed

Typo in error message when an incorrect key is used with WeakKeyMap

Added by andrykonchin (Andrew Konchin) 18 days ago. Updated 9 days ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:120878]

Description

The ObjectSpace::WeakKeyMap#[]= method raises exception when key is either Symbol, Numeric or true/false/nil but error message looks like a bit incorrect:

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.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like1Like0