From 2feea55b31ba6b77957644d968a2ed3b85c36a97 Mon Sep 17 00:00:00 2001 From: Juan Jose Garcia Ripoll Date: Mon, 26 Dec 2011 23:16:13 +0100 Subject: [PATCH] Propagate the type of a function when invoked through APPLY --- src/cmp/cmpfun.lsp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/cmp/cmpfun.lsp b/src/cmp/cmpfun.lsp index a54d47b4d..750a0b7f4 100644 --- a/src/cmp/cmpfun.lsp +++ b/src/cmp/cmpfun.lsp @@ -32,7 +32,13 @@ (member (caadr fun) '(LAMBDA EXT::LAMBDA-BLOCK))) (c1apply (list* (second fun) arguments))) (t - (c1funcall (list* '#'APPLY args)))))) + (let ((form (c1funcall (list* '#'APPLY args)))) + (when (and (consp fun) (eq (first fun) 'FUNCTION)) + (let* ((fname (second fun)) + (type (get-return-type fname))) + (when type + (setf (c1form-type form) type)))) + form))))) ;;---------------------------------------------------------------------- ;; We transform BOOLE into the individual operations, which have