Skip to content

Commit

Permalink
completely initialize SystemError (JuliaLang#44192)
Browse files Browse the repository at this point in the history
  • Loading branch information
sjkelly authored and LilithHafner committed Feb 22, 2022
1 parent 0dbd537 commit ed738a9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion base/io.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ struct SystemError <: Exception
extrainfo
SystemError(p::AbstractString, e::Integer, extrainfo) = new(p, e, extrainfo)
SystemError(p::AbstractString, e::Integer) = new(p, e, nothing)
SystemError(p::AbstractString) = new(p, Libc.errno())
SystemError(p::AbstractString) = new(p, Libc.errno(), nothing)
end

lock(::IO) = nothing
Expand Down
5 changes: 5 additions & 0 deletions test/error.jl
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,8 @@ end
# non-Functions
@test retry(Float64)(1) === 1.0
end

@testset "SystemError initialization" begin
e = SystemError("fail")
@test e.extrainfo === nothing
end

0 comments on commit ed738a9

Please sign in to comment.