<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Fri, May 5, 2017 at 4:00 PM Xiaodi Wu &lt;<a href="mailto:xiaodi.wu@gmail.com">xiaodi.wu@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>The reason I suggest this is that the most consistent boundary with the rest of Swift is the module. I don&#39;t doubt that some may wish to deprecate features even for some subset of internal users, but it seems plainly obvious to me that the more common scenario will be deprecating for public consumption only.</div></blockquote><div><br></div><div>Normally I&#39;d agree with this—I tend to think caring too much about access control beyond internal/external API boundaries is a bit too fine-grained. But...</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>Since you&#39;re presenting scenarios in which it might make sense to have scope-based or file-based deprecation, then more fine tuning would be the answer. Without that, I&#39;d argue the default ought to be what I call &quot;public deprecated.&quot; The within-a-module use case should be the later addition.<br></div></blockquote><div><br></div><div>After seeing some of the considerations from other folks who replied in the thread, I&#39;ve come around to your suggestion that more fine-tuning is the best approach moving forward.</div><div><br></div><div>The case for deprecate-externally-but-not-internally was made well (a library has to maintain conformances to/constraints against deprecated protocols throughout their module and wants to do so without build noise, even if the protocols are deprecated externally). Likewise, deprecated-everywhere as a refactoring tool can be a boon to developer productivity. So, thanks to those who replied with those use cases—that&#39;s the kind of feedback I was looking for. :)</div><div><br></div><div>Protocol buffers (and more generally, many code-generation use cases) pose a unique kind of problem where deprecated-outside-of-the-file/scope is valuable. Deprecate-externally isn&#39;t helpful here because of the nature of how Swift modules and Xcode play together—until Xcode supports static libraries with Swift code, users who want to package something like protobufs are going to generate that code into the same module as the rest of their app&#39;s code. This would make deprecated-externally unable to filter out the warnings that I want to ignore inside the generated code itself.</div><div><br></div><div>So I&#39;m happy to update my draft to define how this would look based on your strawman syntax, but I imagine that it&#39;s now getting past the point of &quot;easy to implement by me or someone else in the Swift 4 timeframe&quot; so I&#39;ll put it on the back burner for the time being.</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div></div><div><br></div><div><br><div class="gmail_quote"><div>On Fri, May 5, 2017 at 17:15 Tony Allevato &lt;<a href="mailto:tony.allevato@gmail.com" target="_blank">tony.allevato@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>I&#39;m inclined to agree. I&#39;m not opposed outright to that degree of configurability but at the same time I wonder if the complexity is needed—it feels like it&#39;s getting close to the &quot;fine-tuned auditing&quot; that I argued against during the discussions about access control.<div><br></div><div>It could also be done additively later, if a significant amount of people using the feature found that they did need it.</div></div><br><div class="gmail_quote"><div>On Fri, May 5, 2017 at 3:09 PM BJ Homer &lt;<a href="mailto:bjhomer@gmail.com" target="_blank">bjhomer@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
&gt; On May 5, 2017, at 1:34 PM, Xiaodi Wu &lt;<a href="mailto:xiaodi.wu@gmail.com" target="_blank">xiaodi.wu@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt; Why guess as to which of these is appropriate? Couldn&#39;t you support the current and all variants of this behavior by allowing access modifiers on &#39;deprecated&#39;?<br>
&gt;<br>
&gt; * public deprecated: warning when used from a different module, behaves as though there&#39;s a public deprecated pass-through<br>
&gt;<br>
&gt; * internal deprecated: warning when used from a different file<br>
&gt;<br>
&gt; * fileprivate deprecated: warning when used from a different scope<br>
&gt;<br>
&gt; * private deprecated: synonymous with deprecated for backwards compatibility, behaves like it does today<br>
&gt;<br>
&gt; (No need for complicated parsing; SE-25 allows a higher nominal access modifier inside a lower one without warning, so it&#39;s fine to allow &#39;public deprecated&#39; to decorate a private member with no effect.)<br>
<br>
I’m not opposed to more configurability like that. I worry it makes the feature more complicated and potentially delays the acceptance or implementation of this feature, though. If it’s easy to implement, though, then sure, I like that.<br>
<br>
-BJ</blockquote></div>
</blockquote></div></div>
</blockquote></div></div>