@@ -2488,7 +2488,7 @@ function abstract_eval_setglobal!(interp::AbstractInterpreter, sv::AbsIntState,
24882488 (rt, exct) = global_assignment_rt_exct (interp, sv, saw_latestworld, gr, v)
24892489 return CallMeta (rt, exct, Effects (setglobal!_effects, nothrow= exct=== Bottom), GlobalAccessInfo (convert (Core. Binding, gr)))
24902490 end
2491- return CallMeta (Union{}, TypeError, EFFECTS_THROWS, NoCallInfo ())
2491+ return CallMeta (Union{}, Union{ TypeError, ErrorException} , EFFECTS_THROWS, NoCallInfo ())
24922492 end
24932493 ⊑ = partialorder (typeinf_lattice (interp))
24942494 if ! (hasintersect (widenconst (M), Module) && hasintersect (widenconst (s), Symbol))
@@ -3444,9 +3444,13 @@ function refine_partial_type(@nospecialize t)
34443444 return t
34453445end
34463446
3447- abstract_eval_nonlinearized_foreigncall_name (interp:: AbstractInterpreter , e, sstate:: StatementState , sv:: IRInterpretationState ) = nothing
3447+ abstract_eval_nonlinearized_foreigncall_name (
3448+ :: AbstractInterpreter , @nospecialize (e), :: StatementState , :: IRInterpretationState
3449+ ) = nothing
34483450
3449- function abstract_eval_nonlinearized_foreigncall_name (interp:: AbstractInterpreter , e, sstate:: StatementState , sv:: AbsIntState )
3451+ function abstract_eval_nonlinearized_foreigncall_name (
3452+ interp:: AbstractInterpreter , @nospecialize (e), sstate:: StatementState , sv:: InferenceState
3453+ )
34503454 if isexpr (e, :call )
34513455 n = length (e. args)
34523456 argtypes = Vector {Any} (undef, n)
@@ -3728,7 +3732,7 @@ end
37283732
37293733function global_assignment_rt_exct (interp:: AbstractInterpreter , sv:: AbsIntState , saw_latestworld:: Bool , g:: GlobalRef , @nospecialize (newty))
37303734 if saw_latestworld
3731- return Pair {Any,Any} (newty, ErrorException)
3735+ return Pair {Any,Any} (newty, Union{TypeError, ErrorException} )
37323736 end
37333737 newty′ = RefValue {Any} (newty)
37343738 (valid_worlds, ret) = scan_partitions (interp, g, sv. world) do interp:: AbstractInterpreter , :: Core.Binding , partition:: Core.BindingPartition
@@ -3743,15 +3747,16 @@ function global_assignment_binding_rt_exct(interp::AbstractInterpreter, partitio
37433747 if is_some_guard (kind)
37443748 return Pair {Any,Any} (newty, ErrorException)
37453749 elseif is_some_const_binding (kind) || is_some_imported (kind)
3746- return Pair {Any,Any} (Bottom, ErrorException)
3750+ # N.B.: Backdating should not improve inference in an earlier world
3751+ return Pair {Any,Any} (kind == PARTITION_KIND_BACKDATED_CONST ? newty : Bottom, ErrorException)
37473752 end
37483753 ty = kind == PARTITION_KIND_DECLARED ? Any : partition_restriction (partition)
37493754 wnewty = widenconst (newty)
37503755 if ! hasintersect (wnewty, ty)
3751- return Pair {Any,Any} (Bottom, ErrorException )
3756+ return Pair {Any,Any} (Bottom, TypeError )
37523757 elseif ! (wnewty <: ty )
37533758 retty = tmeet (typeinf_lattice (interp), newty, ty)
3754- return Pair {Any,Any} (retty, ErrorException )
3759+ return Pair {Any,Any} (retty, TypeError )
37553760 end
37563761 return Pair {Any,Any} (newty, Bottom)
37573762end
0 commit comments