Skip to content

Instantly share code, notes, and snippets.


cbarrett/fallthrough.swift Secret

Created Dec 6, 2015
What would you like to do?
extension Planet {
var number: Int {
var num = 0
switch self {
case .Neptune:
num += 1; fallthrough
case .Uranus:
num +=1; fallthrough
case .Saturn:
// Etc...
return num
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.