Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
inference: callsite conditional argument type refinement
- within a callee (i.e. `typeinf_local`), we widen conditional return type if it doesn't refine input argument type (for better cache) - within a caller (i.e. `abstract_call_gf_by_type`), we re-form a conditional if needed, which allows us to choose a propagation target more appropriately this commit implements the "pick up" logic within a caller (i.e. within `abstract_call_gf_by_type`), which allows us to choose a constraint more appropriately, and now the `Meta.isexpr` case is fixed. Still there is a limitation of multiple conditional constraint back-propagation; the following broken test case will explain the future work. ```julia is_int_and_int(a, b) = isa(a, Int) && isa(b, Int) @test_broken Base.return_types((Any,Any)) do a, b is_int_and_int(a, b) && return a, b # (a::Int, b::Int) ideally, but (a::Any, b::Int) 0, 0 end == Any[Tuple{Int,Int}] ```
- Loading branch information