diff --git a/src/cl-functions.lisp b/src/cl-functions.lisp index 361718b..4a69b18 100644 --- a/src/cl-functions.lisp +++ b/src/cl-functions.lisp @@ -152,7 +152,7 @@ (defmethod custom-form-type ((first (eql 'values)) args env) (values `(values ,@(loop :for form :in args - :collect (form-type form env))) + :collect (nth-form-type form env))) t)) (defmethod custom-form-type ((first (eql 'coerce)) arguments env) diff --git a/test/custom-types.lisp b/test/custom-types.lisp index c9977b4..f375733 100644 --- a/test/custom-types.lisp +++ b/test/custom-types.lisp @@ -121,3 +121,19 @@ (is-form-type t (coerce) :strict t)))) + +(test (values :compile-at :run-time) + "Test FORM-TYPE on VALUES forms" + + (flet ((bar (x) + (declare (ignore x)) + (list 1 2 3 4))) + (declare (ftype (function * (values &rest number)) bar)) + + (is-form-type string + (values "" (bar x))) + + (is-form-type number + (values "" (bar x)) + + :n 1)))