From f7cd0fd6034839a501e9fb65572e46a45e49722b Mon Sep 17 00:00:00 2001
From: ram <ram>
Date: Mon, 6 Aug 1990 15:13:11 +0000
Subject: [PATCH] When substituting for the result continuation in let
 conversion, intersect the combination's derived type with the derived types
 of the dummy's uses.  This serves to propagate TRULY-THE through lets.

---
 compiler/locall.lisp | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/compiler/locall.lisp b/compiler/locall.lisp
index e75f39b32..161a5e0ec 100644
--- a/compiler/locall.lisp
+++ b/compiler/locall.lisp
@@ -617,6 +617,10 @@
 ;;; for the actual continuation; in all other cases assertions on the dummy
 ;;; continuation are lost.
 ;;;
+;;;    We also intersect the derived type of the call with the derived type of
+;;; all the dummy continuation's uses.  This serves mainly to propagate
+;;; TRULY-THE through lets.
+;;;
 (defun move-return-uses (fun call)
   (declare (type clambda fun) (type basic-combination call))
   (let ((return (lambda-return fun)))
@@ -625,9 +629,14 @@
       (delete-return return)
 
       (let ((result (return-result return))
-	    (cont (node-cont call)))
+	    (cont (node-cont call))
+	    (call-type (node-derived-type call)))
 	(when (eq (continuation-use cont) call)
 	  (assert-continuation-type cont (continuation-asserted-type result)))
+	(unless (eq call-type *wild-type*)
+	  (do-uses (use result)
+	    (derive-node-type use call-type)))
+	  
 	(delete-continuation-use call)
 	(add-continuation-use call (node-prev (lambda-bind fun)))
 	(substitute-continuation-uses cont result))))
-- 
GitLab