Skip to content

Commit

Permalink
#26 Removed optional chaining in lambdas
Browse files Browse the repository at this point in the history
  • Loading branch information
Angel Garcia authored and Angel Garcia committed Feb 3, 2018
1 parent f115fce commit b2fa60f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
9 changes: 8 additions & 1 deletion Sources/SwiftKotlinFramework/KotlinTokenizer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,14 @@ public class KotlinTokenizer: SwiftTokenizer {
}
}


open override func tokenize(_ expression: OptionalChainingExpression) -> [Token] {
var tokens = tokenize(expression.postfixExpression)
if tokens.last?.value != "this" {
tokens.append(expression.newToken(.symbol, "?"))
}
return tokens
}

// MARK: - Types
open override func tokenize(_ type: ArrayType, node: ASTNode) -> [Token] {
return
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
userService.updateUser(picture = picture).always {
this?.hasPhoto = true
this.hasPhoto = true
}
userService.autoLinkTenant(tenantId = tenant.id).then { _ ->
this?.startPayment(paymentMethod, true)
this.startPayment(paymentMethod, true)
}.catchError { _ ->
val intent = this?.coordinator?.autoRegisterIntent(tenant = tenant, onComplete = { this?.startPayment(paymentMethod, true) })
this?.navigationManager?.show(intent, animation = .push)
val intent = this.coordinator.autoRegisterIntent(tenant = tenant, onComplete = { this.startPayment(paymentMethod, true) })
this.navigationManager.show(intent, animation = .push)
}
item.selectCallback = { option ->
presenter.selectPaymentMethod(option)
Expand Down

0 comments on commit b2fa60f

Please sign in to comment.