<div dir="ltr">This may sound rather strange in the abstract, but recently I have encountered two situations where I would like to have a setter that accepts a different type than the getter returns.<div><br></div><div>In the first, the getter returns Foo and the setter should accept “@escaping @autoclosure () -&gt; Foo”, so that the expression assigned to the property is not evaluated until it is needed. (The closure is stored in a private property, which the getter evaluates then caches the result.)</div><div><br></div><div>In the second, I want a subscript whose getter returns a concrete type (in my case, subscripting a matrix by row returns an ArraySlice&lt;Element&gt;) while the setter can accept something more generic (any kind of Collection with the correct Element type).</div><div><br></div><div>Thoughts?</div><div><br></div><div>Nevin</div></div>