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
effects: taint :nothrow effect on unknown :static_parameter (#46791)
* effects: taint `:nothrow` effect on unknown `:static_parameter` (conservatively)
With this commit, we taint `:nothrow` effect property correctly on
access to unknown `:static_parameter`, e.g.:
```julia
unknown_sparam_throw(::Union{Nothing, Type{T}}) where T = (T; nothing)
@test Core.Compiler.is_nothrow(Base.infer_effects(unknown_sparam_throw, ((Type{Int},))))
@test !Core.Compiler.is_nothrow(Base.infer_effects(unknown_sparam_throw, ((Nothing,))))
```
This commit implements a very conservative analysis, and thus there is a
room for improvement still, e.g.:
```julia
unknown_sparam_nothrow(x::Ref{T}) where {T} = (T; nothing)
@test_broken Core.Compiler.is_nothrow(Base.infer_effects(unknown_sparam_nothrow, (Ref,)))
```
* inference: improve `:nothrow` modeling for `:static_parameter` (#46820)
* Fix test with free type params
* Test: Ignore ::Type{T} in detect_unbounded
These are only technically unbounded because of the existence of
ill-formed types. However, this function is supposed to be an API
sanity check and ordinary users should never have ill-formed types,
so for the purpose we want here, allow unboundedness in Type{T}.
---------
Co-authored-by: Keno Fischer <[email protected]>
Co-authored-by: Elliot Saba <[email protected]>
(cherry picked from commit b5d17ea)
0 commit comments