Created
March 18, 2020 15:15
-
-
Save christopherweems/f85eb87846f37b1728a0a1b9f601be3b to your computer and use it in GitHub Desktop.
Swift: Incomplete Int range in `switch`
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
// Swift should suggest the remaining cases, | |
// to a novice it is not clear why this does not cover | |
// the full range of values of an Int | |
switch semVersion.major { | |
case 10...: | |
return 6 | |
case ...9: | |
return 5 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment