forked from JuliaLang/julia
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
inference: prioritize
SlotNumber
-constraint over MustAlias
-constr…
…aint (JuliaLang#49856) Currently external `AbstractInterpreter` that uses `MustAliasesLattice` can fail to propagate type constraint on `SlotNumber` in the call-site refinement, e.g. fail to infer the return type of `firstitem(::ItrList)` in the following code: ```julia struct ItrList list::Union{Tuple{},Vector{Int}} end hasitems(list) = length(list) >= 1 function firstitem(ilist::ItrList) list = ilist.list if hasitems(list) return list end error("list is empty") end ``` (xref: <aviatesk/JET.jl#509 (comment)>) This commit fixes it up as well as fixes the implementation of `from_interprocedural!` so that it uses the correct lattice.
- Loading branch information
Showing
2 changed files
with
44 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters