<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">I’d be in favor of this. I was trying this out in a Playground and was trying to remember what the implicit keyword was to get the changed value. Migration wouldn’t be bad. newValue could just be added as an explicitly named parameter to setters that have none. I’m not a fan of these corners of Swift where things are so implicit. But this seems to me to be a problem with Swift where the behavior of the setter is non-obvious enough a developer could slip up. I’d be especially worried about users that are new to the language or new to development making this mistake.<div class=""><br class=""></div><div class="">I can understand the counter argument of wanting the shorthand to be present for reducing code cruft. But from my perspective it’s reducing visibility and readability. At the very least, the more compact usage doesn’t feel natural to me. But maybe that’s just me.<br class=""><div class=""><br class=""><div class=""><div><blockquote type="cite" class=""><div class="">On Dec 15, 2015, at 6:39 PM, Dennis Lysenko via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><p dir="ltr" class="">Other possible solution: why not just remove the default "newValue" and force the user to manually specify it instead? </p>
<br class=""><div class="gmail_quote"><div dir="ltr" class="">On Tue, Dec 15, 2015, 6:02 PM&nbsp;Marc Knaup via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class=""><div class="">Hello everyone,</div><div class=""><br class=""></div><div class="">I would like to propose yielding a warning when a property's getter is used from within its setter implicitly without using "self.".</div><div class=""><br class=""></div><div class="">This can lead to programming errors which are very easy to miss and lead to unexpected behavior at runtime.</div><div class=""><br class=""></div><div class="">Check out the full proposal here:</div><a href="https://github.com/fluidsonic/swift-evolution/blob/master/proposals/NNNN-warn-about-implicit-property-access-in-own-setter.md" target="_blank" class="">https://github.com/fluidsonic/swift-evolution/blob/master/proposals/NNNN-warn-about-implicit-property-access-in-own-setter.md</a><br class=""><div class=""><br class=""></div><div class="">Thank you,</div><div class="">&nbsp; Marc</div></div>
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=8CZIdLciSFC-2BO5jF-2FiP8qN7dBFsgCUZ50wdTsolcRPf8FzAFZH7Vojj-2FW-2Fe7CaA-2BUfJqByzjU-2FgIsB9LwTat5ylA4xlwdmWyy1fZ1GfLpWivP1BZAnm2LJnmmAx-2BY2boAOWEPYoTAMKxB95HEB4ztSN33sH-2FY2-2BcjaE0NqXueQEiAF3or4-2Fh35V0aB7oB59gtXMYLXl8iTxC7QseJu24kB9a8qiBpZm31VMGrtfyTFM-3D" alt="" width="1" height="1" border="0" style="min-height:1px!important;width:1px!important;border-width:0!important;margin-top:0!important;margin-bottom:0!important;margin-right:0!important;margin-left:0!important;padding-top:0!important;padding-bottom:0!important;padding-right:0!important;padding-left:0!important" class="">
_______________________________________________<br class="">
swift-evolution mailing list<br class="">
<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a><br class="">
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class="">
</blockquote></div>
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=OFgvmg1J6naJevMotmPmRgzA4p1gcL5s2O89Xj3c0DS82-2BzCGTeAFuhun3qBZ3e6-2FBWbdjkwLTBhm2xHg5ZB9vrD-2B1WNwGHpbFr3TwkqFr1R3-2FoiHjSpyu2Kn4TFr-2BQTPgOdOI-2BcRDYrOx66bPGAcrGFt70TebMDxJIz0GqIodOSR-2BkxGrBcL6YNxQL6F34I1PDYnTo6ybZKK-2BmRg7XULrmVIxkm3tEFxOWOdMAHMbE-3D" alt="" width="1" height="1" border="0" style="height:1px !important;width:1px !important;border-width:0 !important;margin-top:0 !important;margin-bottom:0 !important;margin-right:0 !important;margin-left:0 !important;padding-top:0 !important;padding-bottom:0 !important;padding-right:0 !important;padding-left:0 !important;" class="">
_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></blockquote></div><br class=""></div></div></div></body></html>