Skip to content

Files

Latest commit

 

History

History
31 lines (22 loc) · 425 Bytes

fallthrough.md

File metadata and controls

31 lines (22 loc) · 425 Bytes

Pattern: Fall-through in switch statement

Issue: -

Description

Fall-throughs should be avoided.

Examples of correct code:

switch foo {
case .bar, .bar2, .bar3:
    something()
}

Examples of incorrect code:

switch foo {
case .bar:
    fallthrough
case .bar2:
    something()
}

Further Reading