[swift-dev] What can you change in a non-exhaustive enum?

Brent Royal-Gordon brent at architechies.com
Tue Oct 3 19:10:25 CDT 2017


> On Sep 29, 2017, at 6:21 PM, Jordan Rose via swift-dev <swift-dev at swift.org> wrote:
> 
> It's time for MagicKit 6 to come out, and we're going to add a new SpellKind:
> 
> @available(MagicKit 6)
> case summoning
> // [charm, curse, hex, blight, jinx, summoning]
> 
> We ship out a beta to our biggest clients, but realize we forgot a vital feature. Beta 2 comes with another new SpellKind:
> 
> @available(MagicKit 6)
> case banishing
> // [charm, curse, hex, blight, jinx, banishing, summoning]
> 
> And now we're in trouble: anything built against the first beta expects 'summoning' to have tag 5, not 6. Our clients have to recompile everything before they can even try out the new version of the library.

Just to check: How much do we need to care about this? It's a beta, after all—clients should expect stuff to break and should rebuild against the new versions as they come out.

If the answer is that this is unacceptable, I think we can come up with a "private revision" syntax for this:

	@available(MagicKit 6r2)
	case banishing

The "r2" might not even show up in the generated header, but the case ordering would take it into account, giving it a lower weight than even the most minor part of the version number.

-- 
Brent Royal-Gordon
Architechies

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-dev/attachments/20171003/148d4423/attachment.html>


More information about the swift-dev mailing list