<div dir="ltr">There&#39;s no way to make a source-breaking change non-breaking. A migration path that meanders through several different designs just increases the aggregate pain over multiple releases. The proposed migration path has the great drawback that, even once approved, no person would actually be allowed to write code that would compile under the final accepted design until several versions in the future.<div><br></div><div>Either this issue about `open` protocols is so important that it meets the bar for a source-breaking change in Swift 4 (see Ted Kremenek&#39;s post about the very stringent criteria), and thus it merits a single discrete break in source compatibility between Swift versions, or it is not sufficiently important.</div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Feb 18, 2017 at 4:44 PM, David Sweeris via swift-evolution <span dir="ltr">&lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
&gt; On Feb 18, 2017, at 14:28, Matthew Johnson &lt;<a href="mailto:matthew@anandabits.com">matthew@anandabits.com</a>&gt; wrote:<br>
&gt;<br>
&gt;<br>
&gt;&gt; On Feb 18, 2017, at 3:52 PM, David Sweeris &lt;<a href="mailto:davesweeris@mac.com">davesweeris@mac.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;&gt; On Feb 18, 2017, at 13:12, Matthew Johnson &lt;<a href="mailto:matthew@anandabits.com">matthew@anandabits.com</a>&gt; wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; On Feb 18, 2017, at 3:01 PM, David Sweeris &lt;<a href="mailto:davesweeris@mac.com">davesweeris@mac.com</a>&gt; wrote:<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; On Feb 18, 2017, at 12:41 PM, Matthew Johnson via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt; wrote:<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; ## Source compatibility<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; This proposal breaks source compatibility, but in a way that allows for a simple mechanical migration.  A multi-release stratgegy will be used to roll out this proposal to provide maximum possible source compatibility from one release to the next.<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; 1. In Swift 4, introduce the `open` keyword and the `@nonopen` attribute (which can be applied to `public protocol` to give it the new semantics of `public`).<br>
&gt;&gt;&gt;&gt;&gt; 2. In Swift 4 (or 4.1 if necessary) start warning for `public protocol` with no annotation.<br>
&gt;&gt;&gt;&gt;&gt; 3. In the subsequent release `public protocol` without annotation becomes an error.<br>
&gt;&gt;&gt;&gt;&gt; 4. In the subsequent relase `public protocol` without annotation takes on the new semantics.<br>
&gt;&gt;&gt;&gt;&gt; 5. `@nonopen` becomes a warning, and evenutally an erro as soon as we are comfortable making those changes.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; I don’t think we need @nonopen or warnings. IMHO, public/open should have the same semantics and syntax regardless of whether the declaration is a protocol or a concrete type (or a property?).<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Other than that nit, I can’t think of a reason to oppose this. So… +1, because I like making things as consistent as possible (also because of the reasons in the motivation).<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; The purpose of using `@nonopen` for the migration is to eventually break people’s code if they don’t use the migrator and don’t annotate it.  If we don’t do that the library may ship a version that unintentionally breaks their clients (by continuing to use `public` after its meaning has changed).<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; It’s better to break the library before it breaks any clients.  That will impact many fewer developers.  This can be handled automatically by the migrator and will be a relatively minor inconvenience for developers who don’t use it.  That’s better than allowing an accidentally bad version of a library from shipping.<br>
&gt;&gt;<br>
&gt;&gt; Do we need it for types? &quot;@nonopen public class Foo {...}&quot;?<br>
&gt;&gt;<br>
&gt;&gt; (Serious question... I don&#39;t recall if we did this phased thing for open vs public types)<br>
&gt;<br>
&gt; No, because we already introduced that in Swift 3.  Swift 4 has a higher bar for breaking changes.  If the core team is willing to accept the proposal without a staged migration strategy I would not object to that.  But I believe it’s best for breaking proposals to present a staged migration strategy for the core team to consider.  That’s what this is.  I wouldn’t want lack of a staged migration strategy to sink the proposal.<br>
<br>
</span>Ah! Ok, I can see that.<br>
<br>
Well, for whatever my opinion is worth, I&#39;d prefer we left that part out. But I&#39;d rather leave it in than for the proposal to get rejected, though.<br>
<div class="HOEnZb"><div class="h5"><br>
- Dave Sweeris<br>
______________________________<wbr>_________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/<wbr>mailman/listinfo/swift-<wbr>evolution</a><br>
</div></div></blockquote></div><br></div></div>