Created
September 19, 2017 13:28
-
-
Save ezura/300ba427db8616499822b2e52186a21a to your computer and use it in GitHub Desktop.
`_` にマッチするよね… #swift #CodePiece
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
switch "" as Optional { | |
case _: | |
print("_") | |
case _?: // ⚠️ Case will never be executed | |
print("_?") | |
//case _??: // ❗️error: '?' pattern cannot match values of type 'String' | |
// print("_??") | |
default: | |
print("s") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment