forked from JuliaLang/julia
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
inference: correctly translate inter-procedural information at everyw…
…here (JuliaLang#42847) There are some remaining cases where we need to call `collect_limitations!` within `abstract_invoke`. Also it turns out we need to handle `InterConditional` in any inter-procedural contexts, so refactored that part within `abstract_call_gf_by_type` and apply the logic everywhere inter-procedural propagation happens. Now `InterConditional` propagation and callsite argument type refinement are enabled for `invoke` and opaque closure call sites, e.g.: ```julia ispositive(a) = isa(a, Int) && a > 0 @test Base.return_types((Any,)) do a if Base.@invoke ispositive(a::Any) return a end return 0 end |> only == Int @test Base.return_types((Any,)) do a f = Base.Experimental.@opaque a -> isa(a, Int) && a > 0 if f(a) return a end return 0 end |> only == Int ``` Co-authored-by: Jameson Nash <[email protected]>
- Loading branch information
Showing
3 changed files
with
165 additions
and
93 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
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