(setf (find-class x) nil) doesn't completely remove the class

Bug #1647043 reported by Stas Boukarev
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Fix Released
Medium
Unassigned

Bug Description

(progn (defclass abc () ())
       (lambda (x) (typep x 'abc))
       (setf (find-class 'abc) nil)
       (lambda (x) (typep x 'abc)))

can't compile TYPEP of anonymous or undefined class:
  #<STANDARD-CLASSOID anonymous {1007EE8B73}>

This is because specifier-type caches the result

(progn (defclass abc () ())
       (sb-kernel:specifier-type 'abc)
       (setf (find-class 'abc) nil)
       (sb-kernel:specifier-type 'abc))
=>
#<STANDARD-CLASSOID anonymous {10093AF653}>

Revision history for this message
Stas Boukarev (stassats) wrote :

sb-kernel:%clear-classoid should probably call values-specifier-type-cache-clear, but how many other caches are there where it can hide?

Revision history for this message
Stas Boukarev (stassats) wrote :

Did just that in 1f3c06ef4d1e1d61cea3156ce76e637c4c6a4225.

Changed in sbcl:
status: Triaged → Fix Committed
Stas Boukarev (stassats)
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.