Nicer error message when using slot-boundp on nil

Bug #732229 reported by Zach Beane
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Fix Released
Low
Unassigned

Bug Description

(slot-boundp nil 'foo) produces a nice error message:

  When attempting to
  test to see whether slot is bound (SLOT-BOUNDP), the slot FOO is
  missing from the object NIL.

Well, the line-breaking is odd, but it's pretty clear what it means.

However, in the non-constant case, the message is different:

  (let ((foo nil)) (slot-boundp foo 'bar)) =>
  There is no applicable method for the generic function
    #<STANDARD-GENERIC-FUNCTION
      (SB-PCL::SLOT-ACCESSOR :GLOBAL BAR BOUNDP) (1)>
  when called with arguments
    (NIL).

It took me a while to figure out what it meant.

Revision history for this message
Zach Beane (xach) wrote :

It seems like this is not just for NIL, but for any kind of non-CLOS-instance object. (I was confused by the NIL case, though.)

Changed in sbcl:
importance: Undecided → Low
status: New → Triaged
Stas Boukarev (stassats)
Changed in sbcl:
status: Triaged → Fix Committed
Changed in sbcl:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.