# Key path cannot refer to '...', which has a mutating getter

**URL:** <https://forums.swift.org/t/key-path-cannot-refer-to-which-has-a-mutating-getter/28856>\
**Category:** Using Swift\
**Created:** [September 16, 2019, 1:38am UTC](https://forums.swift.org/t/key-path-cannot-refer-to-which-has-a-mutating-getter/28856 "2019-09-16T01:38:22Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![John\_McCall](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/john_mccall/32/1351_2.png) [@John\_McCall](https://forums.swift.org/u/John_McCall)\
**Post date:** [September 16, 2019, 10:59pm UTC](https://forums.swift.org/t/key-path-cannot-refer-to-which-has-a-mutating-getter/28856/7 "2019-09-16T22:59:08Z")

</div>

Supporting mutating getters would require a combinatorial explosion of key-path types for very little gain. We currently have five key path types: `AnyKeyPath` (immutable, fully type-erased), `PartialKeyPath` (immutable, type-erased value), `KeyPath` (immutable), `WritableKeyPath` (mutable, mutating setter), and `ReferenceWritableKeyPath` (mutable, non-mutating setter). To support mutating getters we would need to double this (with the possible exception of `AnyKeyPath`). It's a corner case that clearly doesn't justify the increase in complexity.

---

_[View the full topic](https://forums.swift.org/t/key-path-cannot-refer-to-which-has-a-mutating-getter/28856)._
