Skip to content

Commit

Permalink
AbstractIOBuffer was not created until after call overloading (JuliaL…
Browse files Browse the repository at this point in the history
  • Loading branch information
tkelman authored and dpsanders committed Feb 1, 2017
1 parent dd45f4c commit 23ac24f
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 23ac24f

Please sign in to comment.