globaldb.lisp WHERE-FROM priority comment incorrect

Bug #1862280 reported by Michael South
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
New
Undecided
Unassigned

Bug Description

globaldb.lisp says:

;;; where this information came from:
;;; :ASSUMED = from uses of the object
;;; :DEFINED = from examination of the definition
;;; :DEFINED-METHOD = implicit, incremental declaration by CLOS.
;;; :DECLARED = from a declaration
;;; :DEFINED trumps :ASSUMED, :DEFINED-METHOD trumps :DEFINED,
;;; and :DECLARED trumps :DEFINED-METHOD.

However...

(declaim (ftype (function (t) t) baz-declared))
(sb-impl::info :function :where-from 'baz-declared) ;; => :DECLARED T
(defgeneric baz-declared (x))
(sb-impl::info :function :where-from 'baz-declared) ;; => :DEFINED-METHOD T

Chain...
pcl/boot.lisp: DEFGENERIC expands into COMPILE-OR-LOAD-DEFGENERIC at compile/top-level/execute time, but then unconditionally calls LOAD-DEFGENERIC.

* COMPILE-OR-LOAD-DEFGENERIC sets WHERE-FROM to :DEFINED unless its already :DECLARED, thus honoring the comment.

* LOAD-DEFGENERIC calls ENSURE-GENERIC-FUNCTION, which calls ENSURE-GENERIC-FUNCTION-USING-CLASS.

* ENSURE-GENERIC-FUNCTION-CLASS fixed-up to real-ensure-gf-using-class--generic-function or real-ensure-gf-using-class--null, both of which call NOTE-GF-SIGNATURE.

* NOTE-GF-SIGNATURE unconditionally sets WHERE-FROM to :DEFINED-METHOD.

Fix...

I suppose NOTE-GF-SIGNATURE could honor :DECLARED, but who knows what that would break and the benefit is minor. N-G-S is deliberately clobbering the much more important declared function signature for good reasons, so to be consistent should clobber everything.

So probably better to just fix comment... patch attached.

$ git log -n 1
commit a55e271b1f4c7b32e547f976053e096f33fd3450 (HEAD -> master, origin/master, origin/HEAD)

$ sbcl --version
SBCL 1.5.4

Revision history for this message
Michael South (mgsouth) wrote :
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.