Skip to content

Commit

Permalink
mark setfield! as consistent (JuliaLang#46184)
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson committed Jul 27, 2022
1 parent b2bf56e commit 9630911
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion base/compiler/tfuncs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1844,7 +1844,8 @@ const _CONSISTENT_BUILTINS = Any[
Core.ifelse,
(<:),
typeassert,
throw
throw,
setfield!
]

const _SPECIAL_BUILTINS = Any[
Expand Down
2 changes: 2 additions & 0 deletions test/compiler/effects.jl
Original file line number Diff line number Diff line change
Expand Up @@ -314,3 +314,5 @@ end |> Core.Compiler.is_effect_free
obj = c ? Some{String}("foo") : Some{Symbol}(:bar)
return getfield(obj, :value)
end |> Core.Compiler.is_consistent

@test Core.Compiler.is_consistent(Base.infer_effects(setindex!, (Base.RefValue{Int}, Int)))

0 comments on commit 9630911

Please sign in to comment.