Skip to content

Commit 625ab10

Browse files
authored
AbstractIOBuffer was not created until after call overloading (#248)
ref JuliaLang/julia#11554
1 parent 0a37517 commit 625ab10

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Compat.jl

+5-1
Original file line numberDiff line numberDiff line change
@@ -1266,10 +1266,14 @@ if isdefined(Core, :String) && isdefined(Core, :AbstractString)
12661266
typealias ASCIIString Core.String
12671267
else
12681268
typealias String Base.ByteString
1269+
if VERSION >= v"0.4.0-dev+5243"
1270+
@compat (::Type{Base.ByteString})(io::Base.AbstractIOBuffer) = bytestring(io)
1271+
elseif VERSION >= v"0.4.0-dev+1246"
1272+
@compat (::Type{Base.ByteString})(io::IOBuffer) = bytestring(io)
1273+
end
12691274
if VERSION >= v"0.4.0-dev+1246"
12701275
@compat (::Type{Base.ByteString})(s::Cstring) = bytestring(s)
12711276
@compat (::Type{Base.ByteString})(v::Vector{UInt8}) = bytestring(v)
1272-
@compat (::Type{Base.ByteString})(io::Base.AbstractIOBuffer) = bytestring(io)
12731277
@compat (::Type{Base.ByteString})(p::Union{Ptr{Int8},Ptr{UInt8}}) = bytestring(p)
12741278
@compat (::Type{Base.ByteString})(p::Union{Ptr{Int8},Ptr{UInt8}}, len::Integer) = bytestring(p, len)
12751279
@compat (::Type{Base.ByteString})(s::AbstractString) = bytestring(s)

0 commit comments

Comments
 (0)