Skip to content

Commit 6e697c3

Browse files
authored
[InteractiveUtils] specify code_warntype vararg length (#59726)
Avoids a stack overflow when mistyping arguments, allowing for a better MethodError. Issue introduced by #51109 Fixes #57597
1 parent eb77459 commit 6e697c3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

stdlib/InteractiveUtils/src/codeview.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,8 @@ function code_warntype(io::IO, arginfo::ArgInfo;
201201
end
202202
code_warntype(io::IO, @nospecialize(f), @nospecialize(tt=Base.default_tt(f)); kwargs...) = code_warntype(io, ArgInfo(f, tt); kwargs...)
203203
code_warntype(io::IO, @nospecialize(argtypes::Union{Tuple,Type{<:Tuple}}); kwargs...) = code_warntype(io, ArgInfo(argtypes); kwargs...)
204-
code_warntype(args...; kwargs...) = (@nospecialize; code_warntype(stdout, args...; kwargs...))
204+
code_warntype(f; kwargs...) = (@nospecialize; code_warntype(stdout, f; kwargs...))
205+
code_warntype(f, argtypes; kwargs...) = (@nospecialize; code_warntype(stdout, f, argtypes; kwargs...))
205206

206207
using Base: CodegenParams
207208

0 commit comments

Comments
 (0)