Skip to content

Commit 0e93f12

Browse files
nsajkoKristofferC
authored andcommitted
Compiler: abstract_apply: declare type of two closure captures (#57684)
These two local variables were, unlike some other ones, missing type declarations. The type declarations are helpful becase the variables get captured and assigned to in the closure `infercalls`, resulting in bad type inference without the type declarations. I don't think there's any drawback to adding the type declarations: * the declared type is concrete * conversion shouldn't ever happen, as only values of the same type get assigned to these variables This change decreases the number of invalidations on loading package TypeDomainNaturalNumbers v6.1.0 (without first loading the REPL) from 981 to 968. The comparison is on top of eba2a33. (cherry picked from commit b1fffb0)
1 parent 36986a0 commit 0e93f12

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Compiler/src/abstractinterpretation.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -1736,8 +1736,8 @@ function abstract_apply(interp::AbstractInterpreter, argtypes::Vector{Any}, si::
17361736
retinfos = ApplyCallInfo[]
17371737
retinfo = UnionSplitApplyCallInfo(retinfos)
17381738
exctype = Union{}
1739-
ctypes´ = Vector{Any}[]
1740-
infos´ = Vector{MaybeAbstractIterationInfo}[]
1739+
ctypes´::Vector{Vector{Any}} = Vector{Any}[]
1740+
infos´::Vector{Vector{MaybeAbstractIterationInfo}} = Vector{MaybeAbstractIterationInfo}[]
17411741
local ti, argtypesi
17421742
local ctfuture::Future{AbstractIterationResult}
17431743
local callfuture::Future{CallMeta}

0 commit comments

Comments
 (0)