Skip to content

Commit 003fd65

Browse files
authored
Improve inference (#111)
1 parent e4b7e0f commit 003fd65

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/stream.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@ function TranscodingStream(codec::Codec, stream::IO;
118118
checkbufsize(bufsize)
119119
checksharedbuf(sharedbuf, stream)
120120
if sharedbuf
121+
# Here, the compiler cannot infer at compile time that the
122+
# stream must be a TranscodingStream, so we need to help the
123+
# compiler along. See https://github.com/JuliaIO/TranscodingStreams.jl/pull/111
124+
stream::TranscodingStream
121125
state = State(Buffer(bufsize), stream.state.buffer1)
122126
else
123127
state = State(bufsize)

0 commit comments

Comments
 (0)