diff --git a/base/strings/io.jl b/base/strings/io.jl index 151909d6405e4e..4dc87ae72c2b51 100644 --- a/base/strings/io.jl +++ b/base/strings/io.jl @@ -9,6 +9,7 @@ function print(io::IO, x) finally unlock(io) end + return nothing end function print(io::IO, xs...) @@ -20,6 +21,7 @@ function print(io::IO, xs...) finally unlock(io) end + return nothing end println(io::IO, xs...) = print(io, xs..., '\n') diff --git a/test/broadcast.jl b/test/broadcast.jl index 4942445111d1b6..76266096efdf7d 100644 --- a/test/broadcast.jl +++ b/test/broadcast.jl @@ -254,3 +254,7 @@ end # Issue 17314 @test broadcast(x->log(log(log(x))), [1000]) == [log(log(log(1000)))] +let io = IOBuffer() + broadcast(x->print(io,x), 1:5) # broadcast with side effects + @test takebuf_array(io) == [0x31,0x32,0x33,0x34,0x35] +end