We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
In Swift, it is common in lambdas to capture self in weak mode and use self? inside the lambda body.
self
self?
In Kotlin, due to GC, this is unnecesary and the ? must be removed.
?
Example:
func changePhoto(picture: Data) { userService.updateUser(picture: picture).always { [weak self] in self?.hasPhoto = true } }
Translates to:
fun changePhoto(picture: Data) { userService.updateUser(picture = picture).always { this?.hasPhoto = true } }
But must be
fun changePhoto(picture: Data) { userService.updateUser(picture = picture).always { this.hasPhoto = true } }
The text was updated successfully, but these errors were encountered:
#26 Removed optional chaining in lambdas
b2fa60f
Fixed with b2fa60f
Sorry, something went wrong.
No branches or pull requests
In Swift, it is common in lambdas to capture
self
in weak mode and useself?
inside the lambda body.In Kotlin, due to GC, this is unnecesary and the
?
must be removed.Example:
Translates to:
But must be
The text was updated successfully, but these errors were encountered: