From 1e1b62604188d1496a432d8cc7990649d770889a Mon Sep 17 00:00:00 2001
From: ram <ram>
Date: Thu, 17 May 1990 13:41:54 +0000
Subject: [PATCH] Changed type check weakening not to choose supertypes that
 are union types (i.e. COMMON).  Also, we don't preserve the original check
 just because there was some supertype predicate.

---
 compiler/checkgen.lisp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/compiler/checkgen.lisp b/compiler/checkgen.lisp
index 445b8f530..11832e35a 100644
--- a/compiler/checkgen.lisp
+++ b/compiler/checkgen.lisp
@@ -106,10 +106,11 @@
 	       (found-super nil))
 	   (dolist (x *type-predicates*)
 	     (let ((stype (car x)))
-	       (when (csubtypep type stype)
-		 (setq found-super t)
+	       (when (and (csubtypep type stype)
+			  (not (union-type-p stype))) ;Not #!% COMMON type.
 		 (let ((stype-cost (type-test-cost stype)))
 		   (when (< stype-cost min-cost)
+		     (setq found-super t)
 		     (setq min-type stype  min-cost stype-cost))))))
 	   (if found-super
 	       min-type
-- 
GitLab