Skip to content

Commit

Permalink
Test to trigger a style-warning - (values) should match a T|NIL return.
Browse files Browse the repository at this point in the history
> Result is a (VALUES &OPTIONAL), not a (VALUES BOOLEAN &OPTIONAL).
  • Loading branch information
phmarek committed Apr 11, 2017
1 parent d602344 commit 91d8390
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/compiler.impure.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -2286,6 +2286,21 @@
(length (clear-derived-types-on-set-fdefn-1)))))
(assert (= 6 (clear-derived-types-on-set-fdefn-2)))))


(declaim (ftype (function () (values (member t nil) &optional)) values-is-a-boolean-return))
(test-util:with-test (:name :values-is-a-boolean-return)
(let* ((*evaluator-mode* :compile)
(*derive-function-types* t)
(compiler-result
(with-output-to-string (*error-output*)
(eval `(progn
(defun values-is-a-boolean-return ()
(if (zerop (random 2))
(values)))))
)))
(assert (string= "" compiler-result))))


(test-util:with-test (:name (:bug-655126 :derive-function-types t))
(let ((*evaluator-mode* :compile)
(*derive-function-types* t))
Expand Down

0 comments on commit 91d8390

Please sign in to comment.