Skip to content

improve some inferrabilities #41495

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vtjnash so I still want #41199 :p

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