<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=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jan 13, 2016, at 8:27, Matthew Johnson 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=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class=""><blockquote type="cite" class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class=""><div class="">The compiler will absolutely, 100%, inescapably need to know which properties a given partial method initializes. Otherwise it can't properly perform its phase one check, and if this proposal breaks safe initialization, it's not going to be accepted.<br class=""><br class="">We could specify that the compiler takes a peek at the implementation and figures out which fields it initializes, or we could specify that the method declares the fields it will initialize. But however we choose to do it, doing it in *some* way is not negotiable.<br class=""></div></div></blockquote><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""></div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">Yes of course it needs to know about what properties are initialized. &nbsp;It does not need to know about which properties have been initialized prior to calling the partial initializer though if we don’t allow it to read pre-initialized properties.</div></div></div></div></blockquote><br class=""></div><div>I know there's a new thread now, but this is simply incorrect. Consider a struct with a single, non-optional AnyObject field:</div><div><br class=""></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div>struct Ref {</div><div>&nbsp; var referent: AnyObject</div><div>&nbsp; init func resetTo(newReferent: AnyObject) {</div><div>&nbsp; &nbsp; referent = newReferent</div><div>&nbsp; }</div><div>&nbsp; init(referent: AnyObject) {</div><div>&nbsp; &nbsp; resetTo.init(referent)</div><div>&nbsp; }</div><div>}</div></blockquote><br class=""><div class="">If 'referent' has already been set, the assignment has to release the old object; if it hasn't, it <i class="">must not</i>&nbsp;touch that memory (which is presumably uninitialized).</div><div class=""><br class=""></div><div class="">I'm not sure if this practically affects the proposal in any way, other than making it a little harder to implement. But it's an important part of the model.</div><div class=""><br class=""></div><div class="">Best,</div><div class="">Jordan</div><div class=""><br class=""></div><div class="">more comments coming on the other thread</div></body></html>