Skip to content

[Sema] NFC: refactor coerceToType() to use switch statments #22681

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 19, 2019

Conversation

davezarzycki
Copy link
Contributor

The current series of "unrelated" if statements makes understanding and updating this function harder than necessary. By using two switch statements, we can avoid these problems and as a bonus, generate more efficient code gen.

The current series of "unrelated" `if` statements makes understanding
and updating this function harder than necessary. By using two `switch`
statements, we can avoid these problems and as a bonus, generate more
efficient code gen.
@davezarzycki
Copy link
Contributor Author

@swift-ci please smoke test

@CodaFi
Copy link
Contributor

CodaFi commented Feb 18, 2019

Overall, looks good. You're absolutely right that this is a twisty piece of work - enough that I suspect tightening things up like this may have closed off a few previously-accessible codepaths. Once the smoke tests pass, I'd sleep better at night if you ran the full tests and the compatibility suite ✨

@davezarzycki
Copy link
Contributor Author

@swift-ci please test platform
@swift-ci please test source compatibility

@davezarzycki
Copy link
Contributor Author

@swift-ci please smoke test linux

1 similar comment
@davezarzycki
Copy link
Contributor Author

@swift-ci please smoke test linux

@davezarzycki davezarzycki merged commit 52aa243 into swiftlang:master Feb 19, 2019
@davezarzycki davezarzycki deleted the coerceToType_switches branch February 19, 2019 13:21
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