Skip to content

Commit 8efdf85

Browse files
authored
improve some inferrabilities (#41495)
1 parent 19ecf00 commit 8efdf85

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

base/errorshow.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ function showerror(io::IO, ex::MethodError)
222222
arg_types = (is_arg_types ? ex.args : typesof(ex.args...))::DataType
223223
f = ex.f
224224
meth = methods_including_ambiguous(f, arg_types)
225-
if length(meth) > 1
225+
if isa(meth, MethodList) && length(meth) > 1
226226
return showerror_ambiguous(io, meth, f, arg_types)
227227
end
228228
arg_types_param::SimpleVector = arg_types.parameters
@@ -898,4 +898,3 @@ function show(io::IO, ::MIME"text/plain", stack::ExceptionStack)
898898
show_exception_stack(io, stack)
899899
end
900900
show(io::IO, stack::ExceptionStack) = show(io, MIME("text/plain"), stack)
901-

base/process.jl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,16 @@ const SpawnIOs = Vector{Any} # convenience name for readability
8484
for io in stdio]
8585
handle = Libc.malloc(_sizeof_uv_process)
8686
disassociate_julia_struct(handle) # ensure that data field is set to C_NULL
87+
(; exec, flags, env, dir) = cmd
8788
err = ccall(:jl_spawn, Int32,
8889
(Cstring, Ptr{Cstring}, Ptr{Cvoid}, Ptr{Cvoid},
8990
Ptr{Tuple{Cint, UInt}}, Int,
9091
UInt32, Ptr{Cstring}, Cstring, Ptr{Cvoid}),
91-
file, cmd.exec, loop, handle,
92+
file, exec, loop, handle,
9293
iohandles, length(iohandles),
93-
cmd.flags,
94-
cmd.env === nothing ? C_NULL : cmd.env,
95-
isempty(cmd.dir) ? C_NULL : cmd.dir,
94+
flags,
95+
env === nothing ? C_NULL : env,
96+
isempty(dir) ? C_NULL : dir,
9697
@cfunction(uv_return_spawn, Cvoid, (Ptr{Cvoid}, Int64, Int32)))
9798
if err != 0
9899
ccall(:jl_forceclose_uv, Cvoid, (Ptr{Cvoid},), handle) # will call free on handle eventually

base/toml_parser.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ function Base.showerror(io::IO, err::ParserError)
323323
# In this case we want the arrow to point one character
324324
pos = err.pos::Int
325325
err.type == ErrUnexpectedEofExpectedValue && (pos += 1)
326-
str1, err1 = point_to_line(err.str, pos, pos, io)
326+
str1, err1 = point_to_line(err.str::String, pos, pos, io)
327327
@static if VERSION <= v"1.6.0-DEV.121"
328328
# See https://github.com/JuliaLang/julia/issues/36015
329329
format_fixer = get(io, :color, false) == true ? "\e[0m" : ""

0 commit comments

Comments
 (0)