[swift-evolution] Handling unknown cases in enums [RE: SE-0192]
Mike Kluev
mike.kluev at gmail.com
Wed Jan 10 18:33:46 CST 2018
on Wed, 10 Jan 2018 07:12:27 +0000 Antoine Cœur <adigitalknight at gmail.com>
wrote:
>
> And what about, as an alternative:
>
> case (_, #unknown): … matches any int and any unknown enum case ...
> case _: … matches anything ...
>
> Then it clearly goes the "pattern matching" way.
>
this will be logical and consistent. or #default everywhere instead of _
case (#default, #unknown):
case #default:
Mike
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20180111/1d7c43c7/attachment.html>
More information about the swift-evolution
mailing list