From 8d6ffa8edf17e9cfc8ad4c240495e930def10905 Mon Sep 17 00:00:00 2001 From: jjgarcia Date: Fri, 19 Dec 2003 10:08:45 +0000 Subject: [PATCH] Warn the user about a type mismatch between the variables in M-V-S-Q and the type that M-V-S-Q assumes (which is always 'T until we find a better method). --- src/cmp/cmpmulti.lsp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/cmp/cmpmulti.lsp b/src/cmp/cmpmulti.lsp index 50d9d74c9..b31c6af55 100644 --- a/src/cmp/cmpmulti.lsp +++ b/src/cmp/cmpmulti.lsp @@ -111,12 +111,16 @@ (c1expr `(let* (,@temp-vars) (multiple-value-setq ,vars ,@(second args)) ,@late-bindings)) - (dolist (var vars - (make-c1form 'MULTIPLE-VALUE-SETQ info (nreverse vrefs) - (c1expr (second args)))) - (setq var (c1vref var)) - (push var vrefs) - (push var (info-changed-vars info))))) + (let ((value (c1expr (second args)))) + (dolist (var vars + (make-c1form 'MULTIPLE-VALUE-SETQ info (nreverse vrefs) value)) + (setq var (c1vref var)) + (push var vrefs) + (unless (type-and 'T (var-type var)) + (cmpwarn "Variable ~s appeared in a MULTIPLE-VALUE-SETQ and declared to have type ~S." + (var-name var) + (var-type var))) + (push var (info-changed-vars info)))))) (defun multiple-value-check (vrefs form) (and (rest vrefs)