Skip to content

Commit

Permalink
AbstractIOBuffer was not created until after call overloading
Browse files Browse the repository at this point in the history
  • Loading branch information
tkelman authored Jul 9, 2016
1 parent 0a37517 commit 91392f9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Compat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1266,10 +1266,14 @@ if isdefined(Core, :String) && isdefined(Core, :AbstractString)
typealias ASCIIString Core.String
else
typealias String Base.ByteString
if VERSION >= v"0.4.0-dev+5243"
@compat (::Type{Base.ByteString})(io::Base.AbstractIOBuffer) = bytestring(io)
elseif VERSION >= v"0.4.0-dev+1246"
@compat (::Type{Base.ByteString})(io::IOBuffer) = bytestring(io)
end
if VERSION >= v"0.4.0-dev+1246"
@compat (::Type{Base.ByteString})(s::Cstring) = bytestring(s)
@compat (::Type{Base.ByteString})(v::Vector{UInt8}) = bytestring(v)
@compat (::Type{Base.ByteString})(io::Base.AbstractIOBuffer) = bytestring(io)
@compat (::Type{Base.ByteString})(p::Union{Ptr{Int8},Ptr{UInt8}}) = bytestring(p)
@compat (::Type{Base.ByteString})(p::Union{Ptr{Int8},Ptr{UInt8}}, len::Integer) = bytestring(p, len)
@compat (::Type{Base.ByteString})(s::AbstractString) = bytestring(s)
Expand Down

0 comments on commit 91392f9

Please sign in to comment.