@@ -111,7 +111,7 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(fun
111
111
arginfo:: ArgInfo , si:: StmtInfo , @nospecialize (atype),
112
112
sv:: AbsIntState , max_methods:: Int )
113
113
𝕃ₚ, 𝕃ᵢ = ipo_lattice (interp), typeinf_lattice (interp)
114
- ⊑ ₚ, ⋤ ₚ, ⊔ ₚ, ⊔ ᵢ = partialorder (𝕃ₚ), strictneqpartialorder (𝕃ₚ), join (𝕃ₚ), join (𝕃ᵢ)
114
+ ⊑ ₚ, ⊔ ₚ, ⊔ ᵢ = partialorder (𝕃ₚ), join (𝕃ₚ), join (𝕃ᵢ)
115
115
argtypes = arginfo. argtypes
116
116
if si. saw_latestworld
117
117
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
309
309
local napplicable = length (applicable)
310
310
local multiple_matches = napplicable > 1
311
311
while inferidx[] <= napplicable
312
- (; match, edges, edge_idx ) = applicable[inferidx[]]
312
+ (; match) = applicable[inferidx[]]
313
313
inferidx[] += 1
314
314
local method = match. method
315
315
local sig = match. spec_types
@@ -343,7 +343,7 @@ function find_method_matches(interp::AbstractInterpreter, argtypes::Vector{Any},
343
343
max_union_splitting:: Int = InferenceParams (interp). max_union_splitting,
344
344
max_methods:: Int = InferenceParams (interp). max_methods)
345
345
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)
347
347
end
348
348
return find_simple_method_matches (interp, atype, max_methods)
349
349
end
@@ -353,7 +353,7 @@ is_union_split_eligible(𝕃::AbstractLattice, argtypes::Vector{Any}, max_union_
353
353
1 < unionsplitcost (𝕃, argtypes) <= max_union_splitting
354
354
355
355
function find_union_split_method_matches (interp:: AbstractInterpreter , argtypes:: Vector{Any} ,
356
- @nospecialize (atype), max_methods:: Int )
356
+ max_methods:: Int )
357
357
split_argtypes = switchtupleunion (typeinf_lattice (interp), argtypes)
358
358
infos = MethodMatchInfo[]
359
359
applicable = MethodMatchTarget[]
@@ -994,7 +994,7 @@ function collect_const_args(argtypes::Vector{Any}, start::Int)
994
994
end
995
995
996
996
function concrete_eval_call (interp:: AbstractInterpreter ,
997
- @nospecialize (f), result:: MethodCallResult , arginfo:: ArgInfo , sv :: AbsIntState ,
997
+ @nospecialize (f), result:: MethodCallResult , arginfo:: ArgInfo , :: AbsIntState ,
998
998
invokecall:: Union{InvokeCall,Nothing} = nothing )
999
999
args = collect_const_args (arginfo, #= start=# 2 )
1000
1000
if invokecall != = nothing
@@ -1006,7 +1006,7 @@ function concrete_eval_call(interp::AbstractInterpreter,
1006
1006
edge = result. edge:: CodeInstance
1007
1007
value = try
1008
1008
Core. _call_in_world_total (world, f, args... )
1009
- catch e
1009
+ catch
1010
1010
# The evaluation threw. By :consistent-cy, we're guaranteed this would have happened at runtime.
1011
1011
# Howevever, at present, :consistency does not mandate the type of the exception
1012
1012
concrete_result = ConcreteResult (edge, result. effects)
@@ -1368,7 +1368,6 @@ function const_prop_call(interp::AbstractInterpreter,
1368
1368
inf_result. result = concrete_eval_result. rt
1369
1369
inf_result. ipo_effects = concrete_eval_result. effects
1370
1370
end
1371
- typ = inf_result. result
1372
1371
return const_prop_result (inf_result)
1373
1372
end
1374
1373
@@ -1466,7 +1465,7 @@ function ssa_def_slot(@nospecialize(arg), sv::InferenceState)
1466
1465
end
1467
1466
1468
1467
# No slots in irinterp
1469
- ssa_def_slot (@nospecialize (arg), sv :: IRInterpretationState ) = nothing
1468
+ ssa_def_slot (@nospecialize (arg), :: IRInterpretationState ) = nothing
1470
1469
1471
1470
struct AbstractIterationResult
1472
1471
cti:: Vector{Any}
@@ -2262,7 +2261,7 @@ function abstract_invoke(interp::AbstractInterpreter, arginfo::ArgInfo, si::Stmt
2262
2261
end
2263
2262
else
2264
2263
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 )
2266
2265
isexact || return Future (CallMeta (Any, Any, Effects (), NoCallInfo ()))
2267
2266
unwrapped = unwrap_unionall (types)
2268
2267
types === Bottom && return Future (CallMeta (Bottom, Any, EFFECTS_THROWS, NoCallInfo ()))
@@ -2344,7 +2343,7 @@ function abstract_finalizer(interp::AbstractInterpreter, argtypes::Vector{Any},
2344
2343
if length (argtypes) == 3
2345
2344
finalizer_argvec = Any[argtypes[2 ], argtypes[3 ]]
2346
2345
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, _, _
2348
2347
return CallMeta (Nothing, Any, Effects (), FinalizerInfo (call. info, call. effects))
2349
2348
end
2350
2349
end
@@ -2369,7 +2368,7 @@ function abstract_throw(interp::AbstractInterpreter, argtypes::Vector{Any}, ::Ab
2369
2368
return Future (CallMeta (Union{}, exct, EFFECTS_THROWS, NoCallInfo ()))
2370
2369
end
2371
2370
2372
- function abstract_throw_methoderror (interp :: AbstractInterpreter , argtypes:: Vector{Any} , :: AbsIntState )
2371
+ function abstract_throw_methoderror (:: AbstractInterpreter , argtypes:: Vector{Any} , :: AbsIntState )
2373
2372
exct = if length (argtypes) == 1
2374
2373
ArgumentError
2375
2374
elseif ! isvarargtype (argtypes[2 ])
@@ -2579,7 +2578,7 @@ end
2579
2578
function abstract_eval_replaceglobal! (interp:: AbstractInterpreter , sv:: AbsIntState , saw_latestworld:: Bool , argtypes:: Vector{Any} )
2580
2579
if ! isvarargtype (argtypes[end ])
2581
2580
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 ]
2583
2582
T = nothing
2584
2583
if isa (M, Const) && isa (s, Const)
2585
2584
M, s = M. val, s. val
@@ -2855,7 +2854,6 @@ function abstract_call_opaque_closure(interp::AbstractInterpreter,
2855
2854
end
2856
2855
2857
2856
function most_general_argtypes (closure:: PartialOpaque )
2858
- ret = Any[]
2859
2857
cc = widenconst (closure)
2860
2858
argt = (unwrap_unionall (cc):: DataType ). parameters[1 ]
2861
2859
if ! isa (argt, DataType) || argt. name != = typename (Tuple)
@@ -3054,7 +3052,7 @@ function abstract_call(interp::AbstractInterpreter, arginfo::ArgInfo, sstate::St
3054
3052
end
3055
3053
si = StmtInfo (! unused, sstate. saw_latestworld)
3056
3054
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
3058
3056
# this only is needed for the side-effect, sequenced before any task tries to consume the return value,
3059
3057
# which this will do even without returning this Future
3060
3058
sv. stmt_info[sv. currpc] = call. info
@@ -3072,7 +3070,7 @@ function abstract_eval_call(interp::AbstractInterpreter, e::Expr, sstate::Statem
3072
3070
end
3073
3071
arginfo = ArgInfo (ea, argtypes)
3074
3072
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, _, _
3076
3074
(; rt, exct, effects, refinements) = call
3077
3075
return RTEffects (rt, exct, effects, refinements)
3078
3076
end
@@ -3081,7 +3079,7 @@ end
3081
3079
function abstract_eval_new (interp:: AbstractInterpreter , e:: Expr , sstate:: StatementState ,
3082
3080
sv:: AbsIntState )
3083
3081
𝕃ᵢ = 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 )
3085
3083
ut = unwrap_unionall (rt)
3086
3084
exct = Union{ErrorException,TypeError}
3087
3085
if isa (ut, DataType) && ! isabstracttype (ut)
@@ -3234,7 +3232,7 @@ function abstract_eval_new_opaque_closure(interp::AbstractInterpreter, e::Expr,
3234
3232
pushfirst! (argtypes, rt. env)
3235
3233
callinfo = abstract_call_opaque_closure (interp, rt,
3236
3234
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
3238
3236
sv. stmt_info[sv. currpc] = OpaqueClosureCreateInfo (callinfo)
3239
3237
nothing
3240
3238
end
@@ -3311,7 +3309,7 @@ function abstract_eval_isdefinedglobal(interp::AbstractInterpreter, mod::Module,
3311
3309
end
3312
3310
end
3313
3311
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)
3315
3313
if rte. exct == Union{}
3316
3314
rt = Const (true )
3317
3315
elseif rte. rt === Union{} && rte. exct === UndefVarError
@@ -3607,13 +3605,10 @@ world_range(compact::IncrementalCompact) = world_range(compact.ir)
3607
3605
3608
3606
function abstract_eval_globalref_type (g:: GlobalRef , src:: Union{CodeInfo, IRCode, IncrementalCompact} )
3609
3607
worlds = world_range (src)
3610
- partition = lookup_binding_partition (min_world (worlds), g)
3611
-
3612
3608
(valid_worlds, rte) = abstract_load_all_consistent_leaf_partitions (nothing , g, WorldWithRange (min_world (worlds), worlds))
3613
3609
if min_world (valid_worlds) > min_world (worlds) || max_world (valid_worlds) < max_world (worlds)
3614
3610
return Any
3615
3611
end
3616
-
3617
3612
return rte. rt
3618
3613
end
3619
3614
@@ -3730,7 +3725,7 @@ scan_leaf_partitions(query::F, interp::AbstractInterpreter, g::GlobalRef, wwr::W
3730
3725
scan_specified_partitions (query, walk_binding_partition, interp, g, wwr)
3731
3726
3732
3727
function scan_partitions (query:: F , interp:: AbstractInterpreter , g:: GlobalRef , wwr:: WorldWithRange ) where F
3733
- walk_binding_partition = function (b:: Core.Binding , partition:: Core.BindingPartition , world :: UInt )
3728
+ walk_binding_partition = function (b:: Core.Binding , partition:: Core.BindingPartition , :: UInt )
3734
3729
Pair {WorldRange, Pair{Core.Binding, Core.BindingPartition}} (
3735
3730
WorldRange (partition. min_world, partition. max_world), b=> partition)
3736
3731
end
@@ -4489,7 +4484,6 @@ function typeinf(interp::AbstractInterpreter, frame::InferenceState)
4489
4484
nextstates = CurrentState[]
4490
4485
takenext = frame. frameid
4491
4486
minwarn = warnlength
4492
- takeprev = 0
4493
4487
while takenext >= frame. frameid
4494
4488
callee = takenext == 0 ? frame : callstack[takenext]:: InferenceState
4495
4489
if ! isempty (callstack)
0 commit comments