Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
inference: fix
[modifyfield!|replacefield!]_tfunc
s (#56310)
Currently the following code snippet results in an internal error: ```julia julia> func(x) = @atomic :monotonic x[].count += 1; julia> let;Base.Experimental.@force_compile x = Ref(nothing) func(x) end Internal error: during type inference of ... ``` This issue is caused by the incorrect use of `_fieldtype_tfunc(π, o, f)` within `modifyfield!_tfunc`, specifically because `o` should be `widenconst`ed, but it isnβt. By using `_fieldtype_tfunc` correctly, we can avoid the error through error-catching in `abstract_modifyop!`. This commit also includes a similar fix for `replacefield!_tfunc` as well.
- Loading branch information