diff --git a/base/io.jl b/base/io.jl index ca653d8970dd9b..817c1bcaad7a30 100644 --- a/base/io.jl +++ b/base/io.jl @@ -129,6 +129,7 @@ function read!(s::IO, a::Vector{UInt8}) for i in 1:length(a) a[i] = read(s, UInt8) end + return a end function read!{T}(s::IO, a::Array{T}) diff --git a/test/core.jl b/test/core.jl index 6fabf8c54076a4..435fe6e0bff45a 100644 --- a/test/core.jl +++ b/test/core.jl @@ -3401,3 +3401,8 @@ b8932 = Vec3_8932(2,2,2) f13261() = (x = (error("oops"),); +(x...)) g13261() = f13261() @test_throws ErrorException g13261() + +#13433, read!(::IO, a::Vector{UInt8}) should return a +type IO13433 <: IO end +Base.read(::IO13433, ::Type{UInt8}) = 0x01 +@test read!(IO13433(), Array(UInt8, 4)) == [0x01, 0x01, 0x01, 0x01]