SE-0169 is under active review, and is about expanding the meaning of scope to include extensions in the same file. The last day of the review period is today.<br><br>What is this about yet another change?<br><div class="gmail_quote"><div dir="ltr">On Tue, Apr 11, 2017 at 14:31 David Hart via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class="gmail_msg">We’re not talking about the same proposal. I’m talking about SE-0169</div><div style="word-wrap:break-word" class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"><div class="gmail_msg"><blockquote type="cite" class="gmail_msg"><div class="gmail_msg">On 11 Apr 2017, at 19:49, Daniel Duan &lt;<a href="mailto:daniel@duan.org" class="gmail_msg" target="_blank">daniel@duan.org</a>&gt; wrote:</div><br class="m_-3927598713202121457Apple-interchange-newline gmail_msg"><div class="gmail_msg"><div style="word-wrap:break-word" class="gmail_msg">This never went into a review. The pull request is still open <a href="https://github.com/apple/swift-evolution/pull/587" class="gmail_msg" target="_blank">https://github.com/apple/swift-evolution/pull/587</a><br class="gmail_msg"><div class="gmail_msg"><blockquote type="cite" class="gmail_msg"><div class="gmail_msg">On Apr 11, 2017, at 10:45 AM, David Hart via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a>&gt; wrote:</div><br class="m_-3927598713202121457Apple-interchange-newline gmail_msg"><div class="gmail_msg"><div dir="auto" class="gmail_msg"><div class="gmail_msg">I don&#39;t want to make any change until Chris has been able to chime in. If he agrees with us, what should be done?</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">• Immediate change in the proposal?</div><div class="gmail_msg">• Would it have to go through a new review?</div><div class="gmail_msg">• Or can the Core Team make the change if it is accepted?</div><div class="gmail_msg"><br class="gmail_msg">On 11 Apr 2017, at 19:01, John McCall &lt;<a href="mailto:rjmccall@apple.com" class="gmail_msg" target="_blank">rjmccall@apple.com</a>&gt; wrote:<br class="gmail_msg"><br class="gmail_msg"></div><blockquote type="cite" class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"><div class="gmail_msg"><blockquote type="cite" class="gmail_msg"><div class="gmail_msg">On Apr 11, 2017, at 12:00 PM, David Hart via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a>&gt; wrote:</div><br class="m_-3927598713202121457Apple-interchange-newline gmail_msg"><div class="gmail_msg"><div 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" class="gmail_msg"><div class="gmail_msg"><br class="m_-3927598713202121457Apple-interchange-newline gmail_msg"><br class="gmail_msg">On 11 Apr 2017, at 16:27, Matthew Johnson &lt;<a href="mailto:matthew@anandabits.com" class="gmail_msg" target="_blank">matthew@anandabits.com</a>&gt; wrote:<br class="gmail_msg"><br class="gmail_msg"></div><blockquote type="cite" class="gmail_msg"><div class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"><br class="gmail_msg">Sent from my iPad</div><div class="gmail_msg"><br class="gmail_msg">On Apr 11, 2017, at 8:53 AM, David Hart via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a>&gt; wrote:<br class="gmail_msg"><br class="gmail_msg"></div><blockquote type="cite" class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"><div class="gmail_msg"><blockquote type="cite" class="gmail_msg"><div class="gmail_msg">On 11 Apr 2017, at 13:29, Jonathan Hull &lt;<a href="mailto:jhull@gbis.com" class="gmail_msg" target="_blank">jhull@gbis.com</a>&gt; wrote:</div><br class="m_-3927598713202121457Apple-interchange-newline gmail_msg"><div class="gmail_msg"><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" class="gmail_msg"><blockquote type="cite" class="gmail_msg"><div class="gmail_msg"><br class="m_-3927598713202121457Apple-interchange-newline gmail_msg">On Apr 11, 2017, at 3:53 AM, David Hart via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a>&gt; wrote:</div><div class="gmail_msg"><div 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" class="gmail_msg"><br class="gmail_msg">On 11 Apr 2017, at 09:40, John McCall &lt;<a href="mailto:rjmccall@apple.com" class="gmail_msg" target="_blank">rjmccall@apple.com</a>&gt; wrote:<br class="gmail_msg"><br class="gmail_msg"></div><blockquote type="cite" 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" class="gmail_msg"><div class="gmail_msg"><div class="gmail_msg"><blockquote type="cite" class="gmail_msg"><div class="gmail_msg">On Apr 11, 2017, at 1:34 AM, David Hart via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a>&gt; wrote:</div><div class="gmail_msg"><div dir="auto" class="gmail_msg"><div class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg">Sent from my iPhone</div>On 11 Apr 2017, at 01:37, Ricardo Parada via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a>&gt; wrote:<br class="gmail_msg"><br class="gmail_msg"></div><blockquote type="cite" class="gmail_msg"><div class="gmail_msg"><div class="gmail_msg">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="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">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="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">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="gmail_msg"><br class="gmail_msg">But then I imagined myself explaining this to someone new to Swift and it just doesn&#39;t seem right. If it becomes convoluted then that&#39;s a red flag that it does not belong in Swift. </div></div></blockquote><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">I understand what you are saying and I wouldn&#39;t be against relaxing that requirement (not talking for Chris here).</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">The model would change from &quot;Types share scopes with their extensions in the same file the type was defined&quot; to &quot;Types and their extensions share the same scope in each file&quot;.</div></div></div></blockquote><div class="gmail_msg"><br class="gmail_msg"></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 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" class="gmail_msg"><br class="gmail_msg"></div><div 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" class="gmail_msg">We had to take a stance and Chris seemed to prefer the rule that was proposed. I didn&#39;t press because I&#39;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 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" class="gmail_msg"><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" class="gmail_msg">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="gmail_msg"><div class="gmail_msg">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<span class="m_-3927598713202121457Apple-converted-space gmail_msg"> </span><b class="gmail_msg">private</b>, to<span class="m_-3927598713202121457Apple-converted-space gmail_msg"> </span><b class="gmail_msg">fileprivate</b>, to<span class="m_-3927598713202121457Apple-converted-space gmail_msg"> </span><b class="gmail_msg">internal</b>, to<span class="m_-3927598713202121457Apple-converted-space gmail_msg"> </span><b class="gmail_msg">public</b>, to<span class="m_-3927598713202121457Apple-converted-space gmail_msg"> </span><b class="gmail_msg">open</b><span class="m_-3927598713202121457Apple-converted-space gmail_msg"> </span>(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<span class="m_-3927598713202121457Apple-converted-space gmail_msg"> </span><b class="gmail_msg">private</b><span class="m_-3927598713202121457Apple-converted-space gmail_msg"> </span>to<span class="m_-3927598713202121457Apple-converted-space gmail_msg"> </span><b class="gmail_msg">fileprivate</b>.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">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="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg"><b class="gmail_msg">Type.swift</b></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">struct A {</div><div class="gmail_msg">}</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg"><b class="gmail_msg">Other.swift</b></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">extension A {</div><div class="gmail_msg">    func foo() {</div><div class="gmail_msg">        bar()</div><div class="gmail_msg">    }</div><div class="gmail_msg">}</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">extension A {</div><div class="gmail_msg">    private func bar() {</div><div class="gmail_msg">    }</div><div class="gmail_msg">}</div><div class="gmail_msg"><br class="gmail_msg"></div></div></blockquote><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">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).</div></div></blockquote><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">It&#39;s mentioned in the Derailed design section:</div><div class="gmail_msg"><span style="background-color:rgba(255,255,255,0)" class="gmail_msg"><br class="gmail_msg"></span></div><div class="gmail_msg"><div class="gmail_msg"><span style="background-color:rgba(255,255,255,0)" class="gmail_msg"><i class="gmail_msg">This proposal does not change the behavior of extensions that are not in the same file as the type - i.e., extensions in a seperate file to the type do not share access between themselves:</i></span></div></div><div class="gmail_msg"><span style="background-color:rgba(255,255,255,0)" class="gmail_msg"><i class="gmail_msg"><br class="gmail_msg"></i></span></div><div class="gmail_msg">But I agree this should be changed if there is no major technical reason against it.</div></div></div></blockquote><div class="gmail_msg"><br class="gmail_msg"></div>I&#39;m not aware of any technical reason why extensions in the same file should not have access to each other&#39;s members.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">John.</div><div class="gmail_msg"><br class="gmail_msg"><blockquote type="cite" class="gmail_msg"><div class="gmail_msg"><div 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" class="gmail_msg"><br class="gmail_msg"><blockquote type="cite" class="gmail_msg"><div class="gmail_msg"><div class="gmail_msg">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 class="gmail_msg"><br class="gmail_msg"></div><blockquote type="cite" class="gmail_msg"><div class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div></div></blockquote><blockquote type="cite" class="gmail_msg"><div class="gmail_msg"><span class="gmail_msg">_______________________________________________</span><br class="gmail_msg"><span class="gmail_msg">swift-evolution mailing list</span><br class="gmail_msg"><span class="gmail_msg"><a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a></span><br class="gmail_msg"><span class="gmail_msg"><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="gmail_msg" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a></span><br class="gmail_msg"></div></blockquote></div></blockquote></div><span 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;float:none;display:inline!important" class="gmail_msg">_______________________________________________</span><br 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" class="gmail_msg"><span 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;float:none;display:inline!important" class="gmail_msg">swift-evolution mailing list</span><br 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" class="gmail_msg"><span 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;float:none;display:inline!important" class="gmail_msg"><a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a></span><br 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" class="gmail_msg"><span 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;float:none;display:inline!important" class="gmail_msg"><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="gmail_msg" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a></span></div></blockquote></div><br class="gmail_msg"></div></blockquote></div>_______________________________________________<br class="gmail_msg">swift-evolution mailing list<br class="gmail_msg"><a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a><br class="gmail_msg"><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="gmail_msg" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class="gmail_msg"></div></blockquote></div><br class="gmail_msg"></div></div></blockquote></div><br class="gmail_msg"></div></div>_______________________________________________<br class="gmail_msg">
swift-evolution mailing list<br class="gmail_msg">
<a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a><br class="gmail_msg">
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" class="gmail_msg" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class="gmail_msg">
</blockquote></div>