diff --git a/compiler/ir1final.lisp b/compiler/ir1final.lisp index 7ecae5e43931b59adf67adb4ddc77327ece5ee85..1dbe66f769fbc558225971e8b089d7351ecce582 100644 --- a/compiler/ir1final.lisp +++ b/compiler/ir1final.lisp @@ -52,9 +52,7 @@ ;;; Check-Free-Function -- Interface ;;; ;;; If the entry is a functional, then we update the global environment -;;; according to the new definition, checking for inconsistency. If the entry -;;; is an unknown global function, then we add the uses into the function's -;;; approximate type. +;;; according to the new definition, checking for inconsistency. ;;; (proclaim '(function check-free-function (t leaf) void)) (defun check-free-function (name leaf) @@ -64,19 +62,15 @@ (dtype (leaf-type leaf)) (*compiler-error-context* (lambda-bind (main-entry leaf)))) (note-name-defined name :function) - - (when (function-type-p dtype) - (ecase where - (:assumed - (let ((approx-type (info function assumed-type name))) - (when approx-type - (valid-approximate-type approx-type dtype)))) - ((:declared :defined) - )) - - (setf (info function type name) dtype) - (clear-info function assumed-type name)) - - (setf (info function kind name) :function) - (setf (info function where-from name) :defined))) + (ecase where + (:assumed + (let ((approx-type (info function assumed-type name))) + (when (and approx-type (function-type-p dtype)) + (valid-approximate-type approx-type dtype)) + (setf (info function type name) dtype) + (setf (info function assumed-type name) nil)) + (setf (info function where-from name) :defined)) + (:declared); No check for now, just keep declared type. + (:defined + (setf (info function type name) dtype))))) (global-var)))