Opened 11 years ago
Closed 11 years ago
#342 closed defect (fixed)
missing default method for gray-streams:stream-finish-output
Reported by: | Anton Vodonosov | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 1.3.0 |
Component: | streams | Version: | 1.3.0-dev |
Keywords: | has-patch has-test | Cc: | |
Parent Tickets: |
Description
Test case:
(ql:quickload :flexi-streams) (let* ((binary-stream (flexi-streams:make-in-memory-output-stream))) (finish-output binary-stream)) The value #<FLEXI-STREAMS::VECTOR-OUTPUT-STREAM {1E566F3}> is not of type #<STANDARD-CLASS FLEXI-STREAMS:FLEXI-OUTPUT-STREAM {7D84CE}>. [Condition of type SIMPLE-TYPE-ERROR] Backtrace: 0: (#<FUNCTION {1C9E6C0}> #<SIMPLE-TYPE-ERROR {FC82A6}> #<FUNCTION {1C9E6C0}>) 1: (APPLY #<FUNCTION {1C9E6C0}> (#<SIMPLE-TYPE-ERROR {FC82A6}> #<FUNCTION {1C9E6C0}>)) 2: (SYSTEM::RUN-HOOK SYSTEM::*INVOKE-DEBUGGER-HOOK* #<SIMPLE-TYPE-ERROR {FC82A6}> #<FUNCTION {1C9E6C0}>) 3: (INVOKE-DEBUGGER #<SIMPLE-TYPE-ERROR {FC82A6}>) 4: (GRAY-STREAMS:STREAM-FINISH-OUTPUT #<FLEXI-STREAMS::VECTOR-OUTPUT-STREAM {1E566F3}>) 5: (SYSTEM::%FINISH-OUTPUT #<FLEXI-STREAMS::VECTOR-OUTPUT-STREAM {1E566F3}>) 6: (FINISH-OUTPUT #<FLEXI-STREAMS::VECTOR-OUTPUT-STREAM {1E566F3}>)
This happens because there is no default method for stream-finish-output.
According to the Gray proposal, default method should exist and do nothing.
The fix:
Index: src/org/armedbear/lisp/gray-streams.lisp =================================================================== --- src/org/armedbear/lisp/gray-streams.lisp (revision 14464) +++ src/org/armedbear/lisp/gray-streams.lisp (working copy) @@ -314,6 +314,10 @@ (declare (ignore stream)) nil) +(defmethod stream-finish-output (stream) + (declare (ignore stream)) + nil) + (defmethod stream-clear-output (stream) (declare (ignore stream)) nil)
Also, ABCL handles the absence of default method not very correctly.
It should signal "no applicable method". What happens here is that flexi-streams overrides
stream-finish-output for one of its classes - FLEXI-STREAMS:FLEXI-OUTPUT-STREAM.
So, I think ABCL sees that there is only one variant of method,
and tries to apply this method, despite we pass object of another class.
And here typecast happen.
Change History (7)
comment:1 Changed 11 years ago by
Keywords: | has-patch has-test added |
---|---|
Milestone: | → 1.3.0 |
comment:2 Changed 11 years ago by
comment:4 Changed 11 years ago by
Ok, I found how to run the tests:
ant -Dabcl.build.incremental=true test.ansi.compiled
comment:5 Changed 11 years ago by
For me, with or without the patch, ant test.ansi.compiled gives the same result:
12 out of 21707 total tests failed:
(CALL-NEXT-METHOD.ERROR.1
CALL-NEXT-METHOD.ERROR.2
MAKE-CONDITION.3
MAKE-CONDITION.4
SXHASH.8
MAP.48
TYPE-OF.1
TYPE-OF.4
MAKE-CONCATENATED-STREAM.30
PRINT.RANDOM-STATE.1
PPRINT-LOGICAL-BLOCK.17
TRACE.8)
Tested on SVN revision 14464
comment:6 Changed 11 years ago by
After redoing my compilation/test environment from scratch, my error has disappeared.
Committed as part of r14605
comment:7 Changed 11 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
With patch the ansi-compiled tests fail: