You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As you know, Swift's switch / case statement allows us to pass parameters via cases. But I faced with this issue today. It doesn't allow you to use same cases with different parameters, but that allows to use create enum without any compile issues while compiling.
If you try to handle cases with switch statement that shows you possible choices according to enum.
But, If you define both of them, Xcode will appear a warning. "Case is already handled by previous patterns; consider removing it"
In addition to; If you define the cases without any parameter label. It won't allow to create same case with different types.
Note: I added all of required screenshots to attachments.
I believe, that's a strange bug, hope to fix soon.
swiftc --version output:
Apple Swift version 4.2.1 (swiftlang-1000.0.42 clang-1000.10.45.1)
Target: x86_64-apple-darwin18.0.0
Regards.
The text was updated successfully, but these errors were encountered:
This is part of the efforts covered by SR-4691. CodaFi (JIRA User), @xedin, do you think it's worth keeping this open for that sub-task, or should we just collapse them together?
Before we do that, I actually don't understand why you can overload by base name at all yet. I didn't implement this part of 155, and the decl checker is supposed to be rejecting these things.
Attachment: Download
Additional Detail from JIRA
md5: 04dfd2e82da06798a8a22a2af1f4e4ed
is duplicated by:
relates to:
Issue Description:
Hello all,
As you know, Swift's switch / case statement allows us to pass parameters via cases. But I faced with this issue today. It doesn't allow you to use same cases with different parameters, but that allows to use create enum without any compile issues while compiling.
If you try to handle cases with switch statement that shows you possible choices according to enum.
But, If you define both of them, Xcode will appear a warning. "Case is already handled by previous patterns; consider removing it"
In addition to; If you define the cases without any parameter label. It won't allow to create same case with different types.
Note: I added all of required screenshots to attachments.
I believe, that's a strange bug, hope to fix soon.
swiftc --version output:
Apple Swift version 4.2.1 (swiftlang-1000.0.42 clang-1000.10.45.1)
Target: x86_64-apple-darwin18.0.0
Regards.
The text was updated successfully, but these errors were encountered: