@@ -549,8 +549,8 @@ function precise_container_type(interp::AbstractInterpreter, @nospecialize(itft)
549
549
if _any (t -> ! isa (t, DataType) || ! (t <: Tuple ) || ! isknownlength (t), utis)
550
550
return Any[Vararg{Any}], nothing
551
551
end
552
- result = Any[rewrap_unionall (p, tti0) for p in utis[1 ]. parameters]
553
- for t in utis[2 : end ]
552
+ result = Any[rewrap_unionall (p, tti0) for p in ( utis[1 ]:: DataType ) . parameters]
553
+ for t:: DataType in utis[2 : end ]
554
554
if length (t. parameters) != length (result)
555
555
return Any[Vararg{Any}], nothing
556
556
end
782
782
783
783
function argtype_by_index (argtypes:: Vector{Any} , i:: Int )
784
784
n = length (argtypes)
785
- if isvarargtype (argtypes[n])
786
- return i >= n ? unwrapva (argtypes[n]) : argtypes[i]
785
+ na = argtypes[n]
786
+ if isvarargtype (na)
787
+ return i >= n ? unwrapva (na) : argtypes[i]
787
788
else
788
789
return i > n ? Bottom : argtypes[i]
789
790
end
@@ -826,7 +827,7 @@ function abstract_call_builtin(interp::AbstractInterpreter, f::Builtin, fargs::U
826
827
rt = builtin_tfunction (interp, f, argtypes[2 : end ], sv)
827
828
if f === getfield && isa (fargs, Vector{Any}) && la == 3 && isa (argtypes[3 ], Const) && isa (argtypes[3 ]. val, Int) && argtypes[2 ] ⊑ Tuple
828
829
cti, _ = precise_container_type (interp, nothing , argtypes[2 ], sv)
829
- idx = argtypes[3 ]. val
830
+ idx = argtypes[3 ]. val:: Int
830
831
if 1 <= idx <= length (cti)
831
832
rt = unwrapva (cti[idx])
832
833
end
@@ -904,10 +905,11 @@ end
904
905
function abstract_call_unionall (argtypes:: Vector{Any} )
905
906
if length (argtypes) == 3
906
907
canconst = true
907
- if isa (argtypes[3 ], Const)
908
- body = argtypes[3 ]. val
909
- elseif isType (argtypes[3 ])
910
- body = argtypes[3 ]. parameters[1 ]
908
+ a3 = argtypes[3 ]
909
+ if isa (a3, Const)
910
+ body = a3. val
911
+ elseif isType (a3)
912
+ body = a3. parameters[1 ]
911
913
canconst = false
912
914
else
913
915
return Any
@@ -916,11 +918,11 @@ function abstract_call_unionall(argtypes::Vector{Any})
916
918
return Any
917
919
end
918
920
if has_free_typevars (body)
919
- if isa ( argtypes[2 ], Const)
920
- tv = argtypes[ 2 ] . val
921
- elseif isa (argtypes[ 2 ], PartialTypeVar)
922
- ptv = argtypes[ 2 ]
923
- tv = ptv . tv
921
+ a2 = argtypes[2 ]
922
+ if isa (a2, Const)
923
+ tv = a2 . val
924
+ elseif isa (a2, PartialTypeVar)
925
+ tv = a2 . tv
924
926
canconst = false
925
927
else
926
928
return Any
@@ -1110,7 +1112,7 @@ end
1110
1112
1111
1113
function abstract_eval_value_expr (interp:: AbstractInterpreter , e:: Expr , vtypes:: VarTable , sv:: InferenceState )
1112
1114
if e. head === :static_parameter
1113
- n = e. args[1 ]
1115
+ n = e. args[1 ]:: Int
1114
1116
t = Any
1115
1117
if 1 <= n <= length (sv. sptypes)
1116
1118
t = sv. sptypes[n]
@@ -1129,7 +1131,7 @@ function abstract_eval_special_value(interp::AbstractInterpreter, @nospecialize(
1129
1131
elseif isa (e, SSAValue)
1130
1132
return abstract_eval_ssavalue (e:: SSAValue , sv. src)
1131
1133
elseif isa (e, Slot)
1132
- return vtypes[slot_id (e)]. typ
1134
+ return ( vtypes[slot_id (e)]:: VarState ) . typ
1133
1135
elseif isa (e, GlobalRef)
1134
1136
return abstract_eval_global (e. mod, e. name)
1135
1137
end
0 commit comments