<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div><br><br>Sent from my iPad</div><div><br>On Apr 11, 2017, at 8:53 AM, David Hart via swift-evolution <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> wrote:<br><br></div><blockquote type="cite"><div><meta http-equiv="Content-Type" content="text/html charset=utf-8"><br class=""><div><blockquote type="cite" class=""><div class="">On 11 Apr 2017, at 13:29, Jonathan Hull <<a href="mailto:jhull@gbis.com" class="">jhull@gbis.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" class=""><div class=""><br class="Apple-interchange-newline">On Apr 11, 2017, at 3:53 AM, David Hart via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><div class=""><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br class="">On 11 Apr 2017, at 09:40, John McCall <<a href="mailto:rjmccall@apple.com" class="">rjmccall@apple.com</a>> wrote:<br class=""><br class=""></div><blockquote type="cite" class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class=""><div class=""><blockquote type="cite" class=""><div class="">On Apr 11, 2017, at 1:34 AM, David Hart via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><div class=""><div dir="auto" class=""><div class=""><div class=""><br class="">Sent from my iPhone</div>On 11 Apr 2017, at 01:37, Ricardo Parada via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:<br class=""><br class=""></div><blockquote type="cite" class=""><div class=""><div class="">I have not voted in favor or against the proposal. I have been reading a lot of responses but I agree with Tony. </div><div class=""><br class=""></div><div class="">When I started reading the proposal everything was more or less fine half way through the proposal because it was reverting private to fileprivate between the type and its extensions within the same file. I said, if you think of the type and its extensions as a unit then it makes sense. I can explain that. </div><div class=""><br class=""></div><div class="">Then it started describing a different behavior among the extensions located in a file separate from the file containing the definition of the type. That just started a whole debate inside my head and I understand the passionate responses on both sides. </div><div class=""><br class="">But then I imagined myself explaining this to someone new to Swift and it just doesn't seem right. If it becomes convoluted then that's a red flag that it does not belong in Swift. </div></div></blockquote><div class=""><br class=""></div><div class="">I understand what you are saying and I wouldn't be against relaxing that requirement (not talking for Chris here).</div><div class=""><br class=""></div><div class="">The model would change from "Types share scopes with their extensions in the same file the type was defined" to "Types and their extensions share the same scope in each file".</div></div></div></blockquote><div class=""><br class=""></div>Oh, I had missed that somehow. I agree that that is a very strange rule. Do you know why it was proposed that way?</div></div></blockquote><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br class=""></div><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;">We had to take a stance and Chris seemed to prefer the rule that was proposed. I didn't press because I'm sure he has reasons for preferring it that way. But I have a preference for generalizing visibility to all extensions, even to those in a different file than the type.</div></div></blockquote></div><br class="" style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class="" style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;">I think there is a technical limitation if the visibility goes beyond the compilation unit (unless whole module optimization is turned on).</div></div></blockquote></div><br class=""><div class="">I’m not suggesting visibility beyond the compilation unit. That would break the hierarchy of visibility layers: accessibility levels have always been contained in one-another and that’s why you can go from <b class="">private</b>, to <b class="">fileprivate</b>, to <b class="">internal</b>, to <b class="">public</b>, to <b class="">open</b> (but not the other way round) without the risk of any compilation error. If all scopes of a type were visible to each other (whatever the file), you could not go from <b class="">private</b> to <b class="">fileprivate</b>.</div><div class=""><br class=""></div><div class="">I’m talking about extensions of the same type in the same file (but in a separate file from the type) to be able to share private members:</div><div class=""><br class=""></div><div class=""><b class="">Type.swift</b></div><div class=""><br class=""></div><div class="">struct A {</div><div class="">}</div><div class=""><br class=""></div><div class=""><b class="">Other.swift</b></div><div class=""><br class=""></div><div class="">extension A {</div><div class=""> func foo() {</div><div class=""> bar()</div><div class=""> }</div><div class="">}</div><div class=""><br class=""></div><div class="">extension A {</div><div class=""> private func bar() {</div><div class=""> }</div><div class="">}</div><div class=""><br class=""></div></div></blockquote><div><br></div><div>If this is not how your proposal already works I missed that aspect earlier and find it extremely perplexing (which is probably why I missed it). It leaves scoped access working as in Swift 3 in exactly the case where it is least useful. We cannot place stored properties in any extensions, let alone extensions in a file other than the one containing the original declaration. </div><div><br></div><blockquote type="cite"><div><div class=""><br class=""></div></div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>swift-evolution mailing list</span><br><span><a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a></span><br><span><a href="https://lists.swift.org/mailman/listinfo/swift-evolution">https://lists.swift.org/mailman/listinfo/swift-evolution</a></span><br></div></blockquote></body></html>