protocol FooProtocol { var value: Int { get } init(value: Int) mutating func increment() } extension FooProtocol { mutating func increment() { self = Self(value: value + 1) } } final class Foo: FooProtocol { let value: Int init(value: Int) { self.value = value } // mutating func increment() { // self = Foo(value: value + 1) // } } func increment(_ self: inout Foo) { self = Foo(value: self.value + 1) } var foo: Foo = .init(value: 0) print(foo.value) foo.increment() //increment(&foo) print(foo.value)