Skip to content

Commit

Permalink
minor fixup for #55705
Browse files Browse the repository at this point in the history
  • Loading branch information
aviatesk committed Sep 10, 2024
1 parent d280792 commit 4aecfcd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion base/compiler/abstractinterpretation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2232,7 +2232,8 @@ function abstract_throw_methoderror(interp::AbstractInterpreter, argtypes::Vecto
elseif !isvarargtype(argtypes[2])
MethodError
else
tmerge(𝕃ᵢ, MethodError, ArgumentError)
= join(typeinf_lattice(interp))
MethodError ArgumentError
end
return CallMeta(Union{}, exct, EFFECTS_THROWS, NoCallInfo())
end
Expand Down
4 changes: 4 additions & 0 deletions test/compiler/inference.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6137,3 +6137,7 @@ end == TypeError
@test Base.infer_exception_type((Char,)) do x
invoke(f_invoke_exct, Tuple{Number}, x)
end == TypeError

@test Base.infer_exception_type((Vector{Any},)) do args
Core.throw_methoderror(args...)
end == Union{MethodError,ArgumentError}

0 comments on commit 4aecfcd

Please sign in to comment.