Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inference: use ssa_def_slot for typeassert refinement #56859

Merged
merged 1 commit into from
Dec 18, 2024

Conversation

aviatesk
Copy link
Member

Allows type refinement in the following kind of case:

julia> @test Base.infer_return_type((Vector{Any},)) do args
           codeinst = first(args)
           if codeinst isa Core.MethodInstance
               mi = codeinst
           else
               codeinst::Core.CodeInstance
               mi = codeinst.def
           end
           return mi
       end == Core.MethodInstance
Test Passed

Allows type refinement in the following kind of case:
```julia
julia> @test Base.infer_return_type((Vector{Any},)) do args
           codeinst = first(args)
           if codeinst isa Core.MethodInstance
               mi = codeinst
           else
               codeinst::Core.CodeInstance
               mi = codeinst.def
           end
           return mi
       end == Core.MethodInstance
Test Passed
```
@aviatesk aviatesk requested a review from vtjnash December 18, 2024 03:19
@aviatesk aviatesk merged commit 03017db into master Dec 18, 2024
7 checks passed
@aviatesk aviatesk deleted the avi/typeassert-refinement-ssa_def_slot branch December 18, 2024 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants