Commit 29b509d
authored
inference: fix
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.[modifyfield!|replacefield!]_tfuncs (#56310)1 parent ac5bb66 commit 29b509d
2 files changed
+19
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1347 | 1347 | | |
1348 | 1348 | | |
1349 | 1349 | | |
1350 | | - | |
| 1350 | + | |
| 1351 | + | |
1351 | 1352 | | |
1352 | 1353 | | |
1353 | 1354 | | |
1354 | 1355 | | |
1355 | 1356 | | |
1356 | | - | |
| 1357 | + | |
| 1358 | + | |
1357 | 1359 | | |
1358 | 1360 | | |
1359 | 1361 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6063 | 6063 | | |
6064 | 6064 | | |
6065 | 6065 | | |
| 6066 | + | |
| 6067 | + | |
| 6068 | + | |
| 6069 | + | |
| 6070 | + | |
| 6071 | + | |
| 6072 | + | |
| 6073 | + | |
| 6074 | + | |
| 6075 | + | |
| 6076 | + | |
| 6077 | + | |
| 6078 | + | |
| 6079 | + | |
| 6080 | + | |
0 commit comments