# willSet causing copy-on-write types to copy on mutations?

**URL:** <https://forums.swift.org/t/willset-causing-copy-on-write-types-to-copy-on-mutations/52103>\
**Category:** Using Swift\
**Created:** [September 15, 2021, 10:30pm UTC](https://forums.swift.org/t/willset-causing-copy-on-write-types-to-copy-on-mutations/52103 "2021-09-15T22:30:20Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![xwu](https://avatars.discourse-cdn.com/v4/letter/x/b487fb/32.png) [@xwu](https://forums.swift.org/u/xwu)\
**Post date:** [September 15, 2021, 10:41pm UTC](https://forums.swift.org/t/willset-causing-copy-on-write-types-to-copy-on-mutations/52103/2 "2021-09-15T22:41:57Z")

</div>

> [@SE-0268 (Review #2) — Review didSet Semantics](https://forums.swift.org/t/se-0268-review-2-review-didset-semantics/31396/97):
>
> There are two ways to give willSet semantics for a non-instantaneous modification (e.g. calling a mutating method on the property): You can do what Swift does today, which is to force the modification to happen to a temporary copy and then call willSet immediately before writing back. You can call willSet before the modification begins. The second makes more sense to me abstractly, but it's totally incompatible with willSet getting passed the new value, and it's a radically different point in…

---

_[View the full topic](https://forums.swift.org/t/willset-causing-copy-on-write-types-to-copy-on-mutations/52103)._
