From 941bd4d855a47cf661a976c95bbbf98df451b120 Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Wed, 4 May 2022 03:06:23 -0400 Subject: [PATCH] Clarify that `modifyproperty!` does not call `convert` --- base/docs/basedocs.jl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/base/docs/basedocs.jl b/base/docs/basedocs.jl index 8cb5c021fabc9..b3391f95d404a 100644 --- a/base/docs/basedocs.jl +++ b/base/docs/basedocs.jl @@ -2758,6 +2758,11 @@ The syntax `@atomic! max(a().b, c)` returns `modifyproperty!(a(), :b, max, c, :sequentially_consistent))`, where the first argument must be a `getfield` expression and is modified atomically. +Unlike [`setproperty!`](@ref Base.setproperty!), the default implementation of +`modifyproperty!` does not call `convert` automatically. Thus, `op` must return a value +that can be stored in the field `f` directly when invoking the default `modifyproperty!` +implementation. + See also [`modifyfield!`](@ref Core.modifyfield!) and [`setproperty!`](@ref Base.setproperty!). """