From acf1803cfe49a8a6dbfa3390713285d67d287568 Mon Sep 17 00:00:00 2001 From: Stas Boukarev Date: Sun, 30 Aug 2015 06:07:07 +0300 Subject: [PATCH] Fix WRITE on stream-designators. WRITE now transforms into %WRITE, which works on stream-designators but is declared to work on STREAM. Change the declaration to STREAM-DESIGNATOR. --- src/compiler/fndb.lisp | 2 +- tests/print.impure.lisp | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/compiler/fndb.lisp b/src/compiler/fndb.lisp index b8333528e..cc51acbf5 100644 --- a/src/compiler/fndb.lisp +++ b/src/compiler/fndb.lisp @@ -1207,7 +1207,7 @@ :derive-type #'result-type-first-arg) (defknown output-object (t stream) null (any explicit-check)) -(defknown %write (t stream) t (any explicit-check)) +(defknown %write (t stream-designator) t (any explicit-check)) (defknown (pprint) (t &optional stream-designator) (values) (explicit-check)) diff --git a/tests/print.impure.lisp b/tests/print.impure.lisp index 0ac242cc9..dfd132c83 100644 --- a/tests/print.impure.lisp +++ b/tests/print.impure.lisp @@ -706,4 +706,10 @@ (funcall (compile nil `(lambda (x) (format nil "~s" (the string x)))) "\\") (prin1-to-string "\\")))) -;;; success + +(with-test (:name :write-stream-nil) + (assert + (equal + (with-output-to-string (*standard-output*) + (funcall (compile nil `(lambda () (write "xx" :stream nil))))) + "\"xx\""))) -- 2.11.4.GIT