Skip to content
Snippets Groups Projects
Commit c6236d0f authored by Robert Goldman's avatar Robert Goldman
Browse files

Merge branch...

Merge branch '142-with-temporary-file-gives-warnings-when-pathname-variable-is-not-used' into 'master'

Draft: Resolve "WITH-TEMPORARY-FILE gives warnings when pathname variable is not used"

Closes #142

See merge request asdf/asdf!221
parents fe6e3ab7 fa9d0d1d
No related branches found
No related tags found
No related merge requests found
...@@ -486,6 +486,22 @@ ...@@ -486,6 +486,22 @@
pn))) pn)))
(assert (not (probe-file pn4)))) (assert (not (probe-file pn4))))
(let (warning)
(handler-bind ((style-warning #'(lambda (c)
(setf warning c)
(muffle-warning c))))
(compile 'test-style-warning-function
'(lambda ()
(let (namestring)
(uiop:with-temporary-file (:stream str :pathname pn :direction :output :prefix "WTF5")
(format str "Checking variable usage.~%")
(setf namestring (namestring pn))
:close-stream
namestring)))))
(assert (null warning)))
(DBG :ensure-gethash) (DBG :ensure-gethash)
(let ((h (make-hash-table :test 'equal))) (let ((h (make-hash-table :test 'equal)))
(assert-equal (multiple-value-list (gethash 1 h 2)) '(2 nil)) (assert-equal (multiple-value-list (gethash 1 h 2)) '(2 nil))
......
...@@ -672,7 +672,7 @@ Upon success, the KEEP form is evaluated and the file is is deleted unless it ev ...@@ -672,7 +672,7 @@ Upon success, the KEEP form is evaluated and the file is is deleted unless it ev
,@before))) ,@before)))
,@(when after ,@(when after
(assert pathnamep) (assert pathnamep)
`((,afterf (,pathname) ,@after)))) `((,afterf (,pathname) (declare (ignorable ,pathname)) ,@after))))
#-gcl (declare (dynamic-extent ,@(when before `(#',beforef)) ,@(when after `(#',afterf)))) #-gcl (declare (dynamic-extent ,@(when before `(#',beforef)) ,@(when after `(#',afterf))))
(call-with-temporary-file (call-with-temporary-file
,(when before `#',beforef) ,(when before `#',beforef)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment