Skip to content

Commit 05f0546

Browse files
aviateskstaticfloat
authored andcommitted
rm unnecessary widenconst_bestguess call (#38871)
the equivalent widening logic is imposed within `typeinf_local`, and so as far as I understand we don't this need `widenconst_bestguess` in `typeinf_edge` (cherry picked from commit 341d6c9)
1 parent 47130c5 commit 05f0546

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

base/compiler/typeinfer.jl

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -759,20 +759,15 @@ function typeinf_edge(interp::AbstractInterpreter, method::Method, @nospecialize
759759
end
760760
typeinf(interp, frame)
761761
update_valid_age!(frame, caller)
762-
return widenconst_bestguess(frame.bestguess), frame.inferred ? mi : nothing
762+
return frame.bestguess, frame.inferred ? mi : nothing
763763
elseif frame === true
764764
# unresolvable cycle
765765
return Any, nothing
766766
end
767767
# return the current knowledge about this cycle
768768
frame = frame::InferenceState
769769
update_valid_age!(frame, caller)
770-
return widenconst_bestguess(frame.bestguess), nothing
771-
end
772-
773-
function widenconst_bestguess(bestguess)
774-
!isa(bestguess, Const) && !isa(bestguess, PartialStruct) && !isa(bestguess, Type) && return widenconst(bestguess)
775-
return bestguess
770+
return frame.bestguess, nothing
776771
end
777772

778773
#### entry points for inferring a MethodInstance given a type signature ####

0 commit comments

Comments
 (0)