@@ -111,7 +111,7 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(fun
111111 arginfo:: ArgInfo , si:: StmtInfo , @nospecialize (atype),
112112 sv:: AbsIntState , max_methods:: Int )
113113 𝕃ₚ, 𝕃ᵢ = ipo_lattice (interp), typeinf_lattice (interp)
114- ⊑ ₚ, ⋤ ₚ, ⊔ ₚ, ⊔ ᵢ = partialorder (𝕃ₚ), strictneqpartialorder (𝕃ₚ), join (𝕃ₚ), join (𝕃ᵢ)
114+ ⊑ ₚ, ⊔ ₚ, ⊔ ᵢ = partialorder (𝕃ₚ), join (𝕃ₚ), join (𝕃ᵢ)
115115 argtypes = arginfo. argtypes
116116 if si. saw_latestworld
117117 add_remark! (interp, sv, " Cannot infer call, because we previously saw :latestworld" )
@@ -309,7 +309,7 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(fun
309309 local napplicable = length (applicable)
310310 local multiple_matches = napplicable > 1
311311 while inferidx[] <= napplicable
312- (; match, edges, edge_idx ) = applicable[inferidx[]]
312+ (; match) = applicable[inferidx[]]
313313 inferidx[] += 1
314314 local method = match. method
315315 local sig = match. spec_types
@@ -343,7 +343,7 @@ function find_method_matches(interp::AbstractInterpreter, argtypes::Vector{Any},
343343 max_union_splitting:: Int = InferenceParams (interp). max_union_splitting,
344344 max_methods:: Int = InferenceParams (interp). max_methods)
345345 if is_union_split_eligible (typeinf_lattice (interp), argtypes, max_union_splitting)
346- return find_union_split_method_matches (interp, argtypes, atype, max_methods)
346+ return find_union_split_method_matches (interp, argtypes, max_methods)
347347 end
348348 return find_simple_method_matches (interp, atype, max_methods)
349349end
@@ -353,7 +353,7 @@ is_union_split_eligible(𝕃::AbstractLattice, argtypes::Vector{Any}, max_union_
353353 1 < unionsplitcost (𝕃, argtypes) <= max_union_splitting
354354
355355function find_union_split_method_matches (interp:: AbstractInterpreter , argtypes:: Vector{Any} ,
356- @nospecialize (atype), max_methods:: Int )
356+ max_methods:: Int )
357357 split_argtypes = switchtupleunion (typeinf_lattice (interp), argtypes)
358358 infos = MethodMatchInfo[]
359359 applicable = MethodMatchTarget[]
@@ -994,7 +994,7 @@ function collect_const_args(argtypes::Vector{Any}, start::Int)
994994end
995995
996996function concrete_eval_call (interp:: AbstractInterpreter ,
997- @nospecialize (f), result:: MethodCallResult , arginfo:: ArgInfo , sv :: AbsIntState ,
997+ @nospecialize (f), result:: MethodCallResult , arginfo:: ArgInfo , :: AbsIntState ,
998998 invokecall:: Union{InvokeCall,Nothing} = nothing )
999999 args = collect_const_args (arginfo, #= start=# 2 )
10001000 if invokecall != = nothing
@@ -1006,7 +1006,7 @@ function concrete_eval_call(interp::AbstractInterpreter,
10061006 edge = result. edge:: CodeInstance
10071007 value = try
10081008 Core. _call_in_world_total (world, f, args... )
1009- catch e
1009+ catch
10101010 # The evaluation threw. By :consistent-cy, we're guaranteed this would have happened at runtime.
10111011 # Howevever, at present, :consistency does not mandate the type of the exception
10121012 concrete_result = ConcreteResult (edge, result. effects)
@@ -1368,7 +1368,6 @@ function const_prop_call(interp::AbstractInterpreter,
13681368 inf_result. result = concrete_eval_result. rt
13691369 inf_result. ipo_effects = concrete_eval_result. effects
13701370 end
1371- typ = inf_result. result
13721371 return const_prop_result (inf_result)
13731372end
13741373
@@ -1466,7 +1465,7 @@ function ssa_def_slot(@nospecialize(arg), sv::InferenceState)
14661465end
14671466
14681467# No slots in irinterp
1469- ssa_def_slot (@nospecialize (arg), sv :: IRInterpretationState ) = nothing
1468+ ssa_def_slot (@nospecialize (arg), :: IRInterpretationState ) = nothing
14701469
14711470struct AbstractIterationResult
14721471 cti:: Vector{Any}
@@ -2262,7 +2261,7 @@ function abstract_invoke(interp::AbstractInterpreter, arginfo::ArgInfo, si::Stmt
22622261 end
22632262 else
22642263 hasintersect (widenconst (types), Union{Method, CodeInstance}) && return Future (CallMeta (Any, Any, Effects (), NoCallInfo ()))
2265- ( types, isexact, isconcrete, istype) = instanceof_tfunc (argtype_by_index (argtypes, 3 ), false )
2264+ types, isexact, _, _ = instanceof_tfunc (argtype_by_index (argtypes, 3 ), false )
22662265 isexact || return Future (CallMeta (Any, Any, Effects (), NoCallInfo ()))
22672266 unwrapped = unwrap_unionall (types)
22682267 types === Bottom && return Future (CallMeta (Bottom, Any, EFFECTS_THROWS, NoCallInfo ()))
@@ -2344,7 +2343,7 @@ function abstract_finalizer(interp::AbstractInterpreter, argtypes::Vector{Any},
23442343 if length (argtypes) == 3
23452344 finalizer_argvec = Any[argtypes[2 ], argtypes[3 ]]
23462345 call = abstract_call (interp, ArgInfo (nothing , finalizer_argvec), StmtInfo (false , false ), sv, #= max_methods=# 1 ):: Future
2347- return Future {CallMeta} (call, interp, sv) do call, interp, sv
2346+ return Future {CallMeta} (call, interp, sv) do call, _, _
23482347 return CallMeta (Nothing, Any, Effects (), FinalizerInfo (call. info, call. effects))
23492348 end
23502349 end
@@ -2369,7 +2368,7 @@ function abstract_throw(interp::AbstractInterpreter, argtypes::Vector{Any}, ::Ab
23692368 return Future (CallMeta (Union{}, exct, EFFECTS_THROWS, NoCallInfo ()))
23702369end
23712370
2372- function abstract_throw_methoderror (interp :: AbstractInterpreter , argtypes:: Vector{Any} , :: AbsIntState )
2371+ function abstract_throw_methoderror (:: AbstractInterpreter , argtypes:: Vector{Any} , :: AbsIntState )
23732372 exct = if length (argtypes) == 1
23742373 ArgumentError
23752374 elseif ! isvarargtype (argtypes[2 ])
@@ -2579,7 +2578,7 @@ end
25792578function abstract_eval_replaceglobal! (interp:: AbstractInterpreter , sv:: AbsIntState , saw_latestworld:: Bool , argtypes:: Vector{Any} )
25802579 if ! isvarargtype (argtypes[end ])
25812580 if length (argtypes) in (5 , 6 , 7 )
2582- (M, s, x, v) = argtypes[2 ], argtypes[3 ], argtypes[ 4 ], argtypes[5 ]
2581+ (M, s, v) = argtypes[2 ], argtypes[3 ], argtypes[5 ]
25832582 T = nothing
25842583 if isa (M, Const) && isa (s, Const)
25852584 M, s = M. val, s. val
@@ -2855,7 +2854,6 @@ function abstract_call_opaque_closure(interp::AbstractInterpreter,
28552854end
28562855
28572856function most_general_argtypes (closure:: PartialOpaque )
2858- ret = Any[]
28592857 cc = widenconst (closure)
28602858 argt = (unwrap_unionall (cc):: DataType ). parameters[1 ]
28612859 if ! isa (argt, DataType) || argt. name != = typename (Tuple)
@@ -3054,7 +3052,7 @@ function abstract_call(interp::AbstractInterpreter, arginfo::ArgInfo, sstate::St
30543052 end
30553053 si = StmtInfo (! unused, sstate. saw_latestworld)
30563054 call = abstract_call (interp, arginfo, si, sv):: Future
3057- Future {Any} (call, interp, sv) do call, interp , sv
3055+ Future {Any} (call, interp, sv) do call, _ , sv
30583056 # this only is needed for the side-effect, sequenced before any task tries to consume the return value,
30593057 # which this will do even without returning this Future
30603058 sv. stmt_info[sv. currpc] = call. info
@@ -3072,7 +3070,7 @@ function abstract_eval_call(interp::AbstractInterpreter, e::Expr, sstate::Statem
30723070 end
30733071 arginfo = ArgInfo (ea, argtypes)
30743072 call = abstract_call (interp, arginfo, sstate, sv):: Future
3075- return Future {RTEffects} (call, interp, sv) do call, interp, sv
3073+ return Future {RTEffects} (call, interp, sv) do call, _, _
30763074 (; rt, exct, effects, refinements) = call
30773075 return RTEffects (rt, exct, effects, refinements)
30783076 end
@@ -3081,7 +3079,7 @@ end
30813079function abstract_eval_new (interp:: AbstractInterpreter , e:: Expr , sstate:: StatementState ,
30823080 sv:: AbsIntState )
30833081 𝕃ᵢ = typeinf_lattice (interp)
3084- rt, isexact = instanceof_tfunc (abstract_eval_value (interp, e. args[1 ], sstate, sv), true )
3082+ rt, _ ... = instanceof_tfunc (abstract_eval_value (interp, e. args[1 ], sstate, sv), true )
30853083 ut = unwrap_unionall (rt)
30863084 exct = Union{ErrorException,TypeError}
30873085 if isa (ut, DataType) && ! isabstracttype (ut)
@@ -3234,7 +3232,7 @@ function abstract_eval_new_opaque_closure(interp::AbstractInterpreter, e::Expr,
32343232 pushfirst! (argtypes, rt. env)
32353233 callinfo = abstract_call_opaque_closure (interp, rt,
32363234 ArgInfo (nothing , argtypes), StmtInfo (true , false ), sv, #= check=# false ):: Future
3237- Future {Any} (callinfo, interp, sv) do callinfo, interp , sv
3235+ Future {Any} (callinfo, interp, sv) do callinfo, _ , sv
32383236 sv. stmt_info[sv. currpc] = OpaqueClosureCreateInfo (callinfo)
32393237 nothing
32403238 end
@@ -3311,7 +3309,7 @@ function abstract_eval_isdefinedglobal(interp::AbstractInterpreter, mod::Module,
33113309 end
33123310 end
33133311
3314- (valid_worlds , rte) = abstract_load_all_consistent_leaf_partitions (interp, gr, sv. world)
3312+ (_ , rte) = abstract_load_all_consistent_leaf_partitions (interp, gr, sv. world)
33153313 if rte. exct == Union{}
33163314 rt = Const (true )
33173315 elseif rte. rt === Union{} && rte. exct === UndefVarError
@@ -3457,11 +3455,8 @@ function abstract_eval_statement_expr(interp::AbstractInterpreter, e::Expr, ssta
34573455 return abstract_eval_static_parameter (interp, e, sv)
34583456 elseif ehead === :gc_preserve_begin || ehead === :aliasscope
34593457 return RTEffects (Any, Union{}, Effects (EFFECTS_TOTAL; consistent= ALWAYS_FALSE, effect_free= EFFECT_FREE_GLOBALLY))
3460- elseif ehead === :gc_preserve_end || ehead === :leave || ehead === :pop_exception ||
3461- ehead === :global || ehead === :popaliasscope
3458+ elseif ehead === :gc_preserve_end || ehead === :leave || ehead === :pop_exception || ehead === :popaliasscope
34623459 return RTEffects (Nothing, Union{}, Effects (EFFECTS_TOTAL; effect_free= EFFECT_FREE_GLOBALLY))
3463- elseif ehead === :globaldecl
3464- return RTEffects (Nothing, Any, EFFECTS_UNKNOWN)
34653460 elseif ehead === :thunk
34663461 return RTEffects (Any, Any, Effects ())
34673462 end
@@ -3485,9 +3480,13 @@ function refine_partial_type(@nospecialize t)
34853480 return t
34863481end
34873482
3488- abstract_eval_nonlinearized_foreigncall_name (interp:: AbstractInterpreter , e, sstate:: StatementState , sv:: IRInterpretationState ) = nothing
3483+ abstract_eval_nonlinearized_foreigncall_name (
3484+ :: AbstractInterpreter , @nospecialize (e), :: StatementState , :: IRInterpretationState
3485+ ) = nothing
34893486
3490- function abstract_eval_nonlinearized_foreigncall_name (interp:: AbstractInterpreter , e, sstate:: StatementState , sv:: AbsIntState )
3487+ function abstract_eval_nonlinearized_foreigncall_name (
3488+ interp:: AbstractInterpreter , @nospecialize (e), sstate:: StatementState , sv:: InferenceState
3489+ )
34913490 if isexpr (e, :call )
34923491 n = length (e. args)
34933492 argtypes = Vector {Any} (undef, n)
@@ -3606,13 +3605,10 @@ world_range(compact::IncrementalCompact) = world_range(compact.ir)
36063605
36073606function abstract_eval_globalref_type (g:: GlobalRef , src:: Union{CodeInfo, IRCode, IncrementalCompact} )
36083607 worlds = world_range (src)
3609- partition = lookup_binding_partition (min_world (worlds), g)
3610-
36113608 (valid_worlds, rte) = abstract_load_all_consistent_leaf_partitions (nothing , g, WorldWithRange (min_world (worlds), worlds))
36123609 if min_world (valid_worlds) > min_world (worlds) || max_world (valid_worlds) < max_world (worlds)
36133610 return Any
36143611 end
3615-
36163612 return rte. rt
36173613end
36183614
@@ -3729,7 +3725,7 @@ scan_leaf_partitions(query::F, interp::AbstractInterpreter, g::GlobalRef, wwr::W
37293725 scan_specified_partitions (query, walk_binding_partition, interp, g, wwr)
37303726
37313727function scan_partitions (query:: F , interp:: AbstractInterpreter , g:: GlobalRef , wwr:: WorldWithRange ) where F
3732- walk_binding_partition = function (b:: Core.Binding , partition:: Core.BindingPartition , world :: UInt )
3728+ walk_binding_partition = function (b:: Core.Binding , partition:: Core.BindingPartition , :: UInt )
37333729 Pair {WorldRange, Pair{Core.Binding, Core.BindingPartition}} (
37343730 WorldRange (partition. min_world, partition. max_world), b=> partition)
37353731 end
@@ -4488,7 +4484,6 @@ function typeinf(interp::AbstractInterpreter, frame::InferenceState)
44884484 nextstates = CurrentState[]
44894485 takenext = frame. frameid
44904486 minwarn = warnlength
4491- takeprev = 0
44924487 while takenext >= frame. frameid
44934488 callee = takenext == 0 ? frame : callstack[takenext]:: InferenceState
44944489 if ! isempty (callstack)
0 commit comments