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.newm[: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.
Subject changed from Type in error message when an incorrect key is used with WeakKeyMap to Typo in error message when an incorrect key is used with WeakKeyMap