Skip to content

Instantly share code, notes, and snippets.

@christopherweems
Created March 18, 2020 15:15
Show Gist options
  • Save christopherweems/f85eb87846f37b1728a0a1b9f601be3b to your computer and use it in GitHub Desktop.
Save christopherweems/f85eb87846f37b1728a0a1b9f601be3b to your computer and use it in GitHub Desktop.
Swift: Incomplete Int range in `switch`
// 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