julia
41b07917 - inference: Add `widen_call_result` interface

Commit
66 days ago
inference: Add `widen_call_result` interface Extract the widening-to-`Any` decision applied to call return types at unused call sites into a new ```julia widen_call_result(interp::AbstractInterpreter, si::StmtInfo, state::CallInferenceState, sv::AbsIntState) ``` interface, mirroring the style of `bail_out_call` and friends. The default implementation preserves existing behavior: ```julia call_result_unused(si) && !(state.rettype === Bottom) ``` This is motivated by use cases such as LSP servers (esp. JETLS), where the widened `Any` shown at unused call sites is misleading to users — for those interpreters, holding the precise inferred return type is more useful. Such consumers can now opt out of (or generalize) the widening by overloading this method without forking the call inference pipeline.
Author
Committer
Parents
Loading