You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[compiler] Teach type inference that GotoIfNot can throw (#48583)
Previously, the effects system would ignore certain cases where
`GotoIfNot` nodes would be capable of throwing; this resulted in simple
examples such as the following being marked as `nothrow`:
```
julia> foo(x) = x > 0 ? x : 0
Base.infer_effects(foo, (Missing,))
(+c,+e,+n,+t,+s,+m,+i)
```
With this change, we correctly notice when a `GotoIfNot` node is given a
non-`Bool` condition, annotate the basic block as possibly throwing, and
further end type inference if the condition is provably non-`Bool`.
0 commit comments