[swift-evolution] Proposal: switchValue

Javier Soto javier.api at gmail.com
Wed Jan 13 11:06:32 CST 2016


I think you can accomplish this with "case let x: precondition(x == 1), or
am I missing something?
On Wed, Jan 13, 2016 at 7:39 AM Amir Michail via swift-evolution <
swift-evolution at swift.org> wrote:

> Example:
>
> switch random() % 2 {
> case 0:
>> default: precondition(switchValue == 1)
>              ...
> }
>
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
>
-- 
Javier Soto
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160113/8ef693f4/attachment.html>


More information about the swift-evolution mailing list