Skip to content

Commit

Permalink
Fix issue #8.
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-gutev committed Dec 16, 2021
1 parent d0c57a6 commit f46969b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/cl-functions.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
16 changes: 16 additions & 0 deletions test/custom-types.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -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)))

0 comments on commit f46969b

Please sign in to comment.