Skip to content

Conversation

@gottesmm
Copy link
Contributor

I just extracted out subroutines using Xcode's refactoring engine. Should be NFC.

Now one can actually read StmtChecker::visitSwitchStmt without getting lost since it is more compact.

…n helper method.

The method StmtChecker::visitSwitchStmt is really large and does a bunch of
different things. This implicit submethod was one of the largest of these. By
extracting this, we make the original method easier to reason about.

Extracting done with Xcode's refactoring engine.
…types into its own helper method.

This is the last "subroutine" I am extracting from StmtChecker::visitSwitchStmt.
It is possible to read easily now without getting lost.
@gottesmm
Copy link
Contributor Author

@swift-ci smoke test and merge


void checkCaseLabelItem(CaseStmt *caseBlock, CaseLabelItem &labelItem,
bool &limitExhaustivityChecks, Type subjectType) {
SWIFT_DEFER {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am actually going to rip out the usage of SWIFT_DEFER here in a subsequent commit and hoist it back into visitSwitchStmt. I just don't want to stop the testing now.

@swift-ci swift-ci merged commit 4d7d2ef into swiftlang:master Mar 15, 2019
@gottesmm gottesmm deleted the pr-cafc42f13f3d474469835f12b2fdc97e9c947c76 branch March 15, 2019 20:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants