Skip to content

Use strongSelf instead of self #1798

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
Dec 11, 2018
Merged

Conversation

lukabratos
Copy link

@lukabratos lukabratos commented Dec 10, 2018

Replace using:

`self`

which is relying on a compiler bug with strongSelf.

Unwrapping self by using strongSelf is already used in other places so this will make the code consistent across the projects.

1.) Prevent using `self` which is relying on a compiler bug: https://github.com/apple/swift-evolution/blob/master/proposals/0079-upgrade-self-from-weak-to-strong.md#relying-on-a-compiler-bug
2.) Unwrapping self by using strongSelf is used already in other places in the project so this will make the code consistent across the project.
@parkera
Copy link
Contributor

parkera commented Dec 11, 2018

@swift-ci test and merge

@linqingmo
Copy link

guard let self = self else { return }

would be better. SE-0079

@swift-ci swift-ci merged commit f51bd9f into swiftlang:master Dec 11, 2018
@lukabratos lukabratos deleted the use-strongself branch December 11, 2018 19:35
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.

4 participants