For context, read: Matching optionals in a switch statement
At the moment, if the enum is optional, you have to use the
? operator to switch over the cases, otherwise an error diagnostic was emitted telling the user that the case does not exist in the enum.
@Joe_Groff has said it's a bug and that it should be allowed to match cases without using
?, but I would like to get the opinion of others including the core team members if this should be considered a bug or not. I have a PR ready that fixes it if the core team agrees it's a bug. Otherwise, I am happy to create a proposal & run it through Swift Evolution when new proposals are being accepted.