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, switch cases can contain where clauses like the following:
where
switch exception { case .generic(let error) where error != nil: trackError(name: "generic", message: error!) default: trackError(name: "generic", message: R.string.localizable.generic_error()) }
Currently, SwiftKotlin generates:
when (exception) { .generic where error != null -> trackError(name = "generic", message = error!!) else -> trackError(name = "generic", message = R.string.localizable.generic_error()) }
But that is incorrect Kotlin. It should instead remove the variable from the when and use expressions for the cases. Like:
when
when { exception is Exception.generic && error != null -> trackError(name = "generic", message = error!!) else -> trackError(name = "generic", message = R.string.localizable.generic_error()) }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
In Swift, switch cases can contain
where
clauses like the following:Currently, SwiftKotlin generates:
But that is incorrect Kotlin. It should instead remove the variable from the
when
and use expressions for the cases. Like:The text was updated successfully, but these errors were encountered: