From 6b04f32bb3801fb504cbadeb6f11d1017c8100e5 Mon Sep 17 00:00:00 2001 From: jjgarcia Date: Thu, 19 May 2005 17:18:59 +0000 Subject: [PATCH] When a routine expects an input/output stream and does not get it, it should be a type-error --- src/c/file.d | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/c/file.d b/src/c/file.d index 94dff864a..784cb294b 100644 --- a/src/c/file.d +++ b/src/c/file.d @@ -244,13 +244,21 @@ static void wrong_file_handler(cl_object strm) /*__attribute__((noreturn))*/; static void not_an_input_stream(cl_object strm) { - FEerror("Cannot read the stream ~S.", 1, strm); + cl_error(9, @'simple-type-error', @':format-control', + make_constant_string("~A is not an input stream"), + @':format-arguments', cl_list(1, strm), + @':expected-type', cl_list(2, @'satisfies', @'input-stream-p'), + @':datum', cl_stream_element_type(strm)); } static void not_an_output_stream(cl_object strm) { - FEerror("Cannot write to the stream ~S.", 1, strm); + cl_error(9, @'simple-type-error', @':format-control', + make_constant_string("~A is not an output stream"), + @':format-arguments', cl_list(1, strm), + @':expected-type', cl_list(2, @'satisfies', @'output-stream-p'), + @':datum', cl_stream_element_type(strm)); } static void