X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fctype.lisp;h=97923ac7d42e6d7b8bc1189fc3f2a24c8e59b8eb;hb=cf607a404d7518e8a18c9e362913f370eb9a5e38;hp=34d69f0f783985e96dbbbd37b2399c65dcbe2848;hpb=29a9ccc860532b32c566aec095f570e999a9c52c;p=sbcl.git diff --git a/src/compiler/ctype.lisp b/src/compiler/ctype.lisp index 34d69f0..97923ac 100644 --- a/src/compiler/ctype.lisp +++ b/src/compiler/ctype.lisp @@ -672,7 +672,7 @@ (try-type-intersections (vars) (res) where)))) -;;; Check that Type doesn't specify any funny args, and do the +;;; Check that TYPE doesn't specify any funny args, and do the ;;; intersection. (defun find-lambda-types (lambda type where) (declare (type clambda lambda) (type fun-type type) (string where)) @@ -742,7 +742,8 @@ ((not really-assert) t) (t (when atype - (assert-continuation-type (return-result return) atype)) + (assert-continuation-type (return-result return) atype + (lexenv-policy (functional-lexenv functional)))) (loop for var in vars and type in types do (cond ((basic-var-sets var) (when (and unwinnage-fun @@ -759,3 +760,24 @@ (dolist (ref (leaf-refs var)) (derive-node-type ref type))))) t)))))) + +(defun assert-global-function-definition-type (name fun) + (declare (type functional fun)) + (let ((type (info :function :type name)) + (where (info :function :where-from name))) + (when (eq where :declared) + (setf (leaf-type fun) type) + (assert-definition-type fun type + :unwinnage-fun #'compiler-note + :where "proclamation")))) + +;;;; FIXME: Move to some other file. +(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 "~@" + (continuation-source tag) + (type-specifier (continuation-type tag))))))