[swift-evolution] Recent change makes Swift 4 less safe.

Adrian Zubarev adrian.zubarev at devandartist.com
Sat Jul 29 00:59:54 CDT 2017


This is intended because () is confusing. If you need that back, simply add (Void).  

For more information read this proposal:  
https://github.com/apple/swift-evolution/blob/master/proposals/0155-normalize-enum-case-representation.md

--  
Adrian Zubarev
Sent with Airmail  

Am 28. Juli 2017 um 23:23:24, Amir Michail via swift-evolution (swift-evolution at swift.org(mailto:swift-evolution at swift.org)) schrieb:

>  
> The latest beta doesn’t allow you to append “()” to an enum name with no associated value in a switch case.
>  
> This makes Swift less safe because appending that “()” is an excellent way to indicate that you are not ignoring the associated value in the swift case because there isn’t any.
>  
> Suppose that you later add an associated value. Then the switch case with the “()” will give a compile error, which is better than silently introducing a bug into your code.
>  
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170729/fa97e791/attachment.html>


More information about the swift-evolution mailing list