# Mutating Function on Class Type (Possible bug?)

**URL:** <https://forums.swift.org/t/mutating-function-on-class-type-possible-bug/15066>\
**Category:** Using Swift\
**Created:** [August 7, 2018, 3:29pm UTC](https://forums.swift.org/t/mutating-function-on-class-type-possible-bug/15066 "2018-08-07T15:29:53Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![jrose](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/jrose/32/408_2.png) [@jrose](https://forums.swift.org/u/jrose)\
**Post date:** [December 20, 2018, 4:48pm UTC](https://forums.swift.org/t/mutating-function-on-class-type-possible-bug/15066/8 "2018-12-20T16:48:31Z")

</div>

We could allow it, sure. But it would only change _this_ reference, not any other references pointing to the same object, and _not_ having `mutating` doesn't prevent you from changing stored properties (see [Avoiding unbreakable reference cycle with value types and closures? - #17 by jrose](https://forums.swift.org/t/avoiding-unbreakable-reference-cycle-with-value-types-and-closures/18757/17)). So it's left out of the language to avoid introducing a point of confusion.

Have you come across a situation where you would have wanted this?

---

_[View the full topic](https://forums.swift.org/t/mutating-function-on-class-type-possible-bug/15066)._
