From 02c785c633f171f9048e1496c8f8e65da4de0dbf Mon Sep 17 00:00:00 2001
From: ram <ram>
Date: Fri, 5 Oct 1990 14:55:58 +0000
Subject: [PATCH] Changed NOTE-FAILED-OPTIMIZATION to redo the check for
 whether the type intersects with the combination type, so that if we later
 discovered that there was no intersection we wouldn't flame.

---
 compiler/ir1final.lisp | 32 ++++++++++++++++++--------------
 1 file changed, 18 insertions(+), 14 deletions(-)

diff --git a/compiler/ir1final.lisp b/compiler/ir1final.lisp
index c997a909d..7ecae5e43 100644
--- a/compiler/ir1final.lisp
+++ b/compiler/ir1final.lisp
@@ -29,20 +29,24 @@
     (let ((*compiler-error-context* node))
       (dolist (failure failures)
 	(let ((what (cdr failure)))
-	  (if (consp what)
-	      (compiler-note "Unable to optimize because:~%~6T~?"
-			     (first what) (rest what))
-	      (collect ((messages))
-		(flet ((frob (string &rest stuff)
-			 (messages string)
-			 (messages stuff)))
-		  (valid-function-use node what
-				      :warning-function #'frob
-				      :error-function #'frob))
-		
-		(compiler-note "Unable to optimize due to type uncertainty:~@
-		                ~{~6T~?~^~&~}"
-			       (messages)))))))))
+	  (cond
+	   ((consp what)
+	    (compiler-note "Unable to optimize because:~%~6T~?"
+			   (first what) (rest what)))
+	   ((valid-function-use node what
+				:argument-test #'types-intersect
+				:result-test #'values-types-intersect)
+	    (collect ((messages))
+	      (flet ((frob (string &rest stuff)
+		       (messages string)
+		       (messages stuff)))
+		(valid-function-use node what
+				    :warning-function #'frob
+				    :error-function #'frob))
+	      
+	      (compiler-note "Unable to optimize due to type uncertainty:~@
+	                      ~{~6T~?~^~&~}"
+			     (messages))))))))))
 
 	  
 ;;; Check-Free-Function  --  Interface
-- 
GitLab