Skip to content

Commit

Permalink
improve some inferrabilities (#41495)
Browse files Browse the repository at this point in the history
  • Loading branch information
aviatesk committed Jul 7, 2021
1 parent 19ecf00 commit 8efdf85
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
3 changes: 1 addition & 2 deletions base/errorshow.jl
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ function showerror(io::IO, ex::MethodError)
arg_types = (is_arg_types ? ex.args : typesof(ex.args...))::DataType
f = ex.f
meth = methods_including_ambiguous(f, arg_types)
if length(meth) > 1
if isa(meth, MethodList) && length(meth) > 1
return showerror_ambiguous(io, meth, f, arg_types)
end
arg_types_param::SimpleVector = arg_types.parameters
Expand Down Expand Up @@ -898,4 +898,3 @@ function show(io::IO, ::MIME"text/plain", stack::ExceptionStack)
show_exception_stack(io, stack)
end
show(io::IO, stack::ExceptionStack) = show(io, MIME("text/plain"), stack)

9 changes: 5 additions & 4 deletions base/process.jl
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,16 @@ const SpawnIOs = Vector{Any} # convenience name for readability
for io in stdio]
handle = Libc.malloc(_sizeof_uv_process)
disassociate_julia_struct(handle) # ensure that data field is set to C_NULL
(; exec, flags, env, dir) = cmd
err = ccall(:jl_spawn, Int32,
(Cstring, Ptr{Cstring}, Ptr{Cvoid}, Ptr{Cvoid},
Ptr{Tuple{Cint, UInt}}, Int,
UInt32, Ptr{Cstring}, Cstring, Ptr{Cvoid}),
file, cmd.exec, loop, handle,
file, exec, loop, handle,
iohandles, length(iohandles),
cmd.flags,
cmd.env === nothing ? C_NULL : cmd.env,
isempty(cmd.dir) ? C_NULL : cmd.dir,
flags,
env === nothing ? C_NULL : env,
isempty(dir) ? C_NULL : dir,
@cfunction(uv_return_spawn, Cvoid, (Ptr{Cvoid}, Int64, Int32)))
if err != 0
ccall(:jl_forceclose_uv, Cvoid, (Ptr{Cvoid},), handle) # will call free on handle eventually
Expand Down
2 changes: 1 addition & 1 deletion base/toml_parser.jl
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ function Base.showerror(io::IO, err::ParserError)
# In this case we want the arrow to point one character
pos = err.pos::Int
err.type == ErrUnexpectedEofExpectedValue && (pos += 1)
str1, err1 = point_to_line(err.str, pos, pos, io)
str1, err1 = point_to_line(err.str::String, pos, pos, io)
@static if VERSION <= v"1.6.0-DEV.121"
# See https://github.com/JuliaLang/julia/issues/36015
format_fixer = get(io, :color, false) == true ? "\e[0m" : ""
Expand Down

0 comments on commit 8efdf85

Please sign in to comment.