0.7.1.24:
[sbcl.git] / src / compiler / ctype.lisp
index 35538ca..3fb91d1 100644 (file)
 ;;; explain the result. We bind *COMPILER-ERROR-CONTEXT* to the
 ;;; combination node so that COMPILER-WARNING and related functions
 ;;; will do the right thing if they are supplied.
-(defun valid-function-use (call type &key
-                               ((:argument-test *ctype-test-fun*) #'csubtypep)
-                               (result-test #'values-subtypep)
-                               (strict-result nil)
-                               ((:lossage-fun *lossage-fun*))
-                               ((:unwinnage-fun *unwinnage-fun*)))
+(defun valid-fun-use (call type &key
+                          ((:argument-test *ctype-test-fun*) #'csubtypep)
+                          (result-test #'values-subtypep)
+                          (strict-result nil)
+                          ((:lossage-fun *lossage-fun*))
+                          ((:unwinnage-fun *unwinnage-fun*)))
   (declare (type function result-test) (type combination call)
           (type fun-type type))
   (let* ((*lossage-detected* nil)
                   (dolist (ref (leaf-refs var))
                     (derive-node-type ref type)))))
          t))))))
+
+(defun check-catch-tag-type (tag)
+  (declare (type continuation tag))
+  (let ((ctype (continuation-type tag)))
+    (when (csubtypep ctype (specifier-type '(or number character)))
+      (compiler-style-warn "~@<using ~S of type ~S as a catch tag (which ~
+                            tends to be unportable because THROW and CATCH ~
+                            use EQ comparison)~@:>"
+                          (continuation-source tag)
+                          (type-specifier (continuation-type tag))))))