Skip to content
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

Initialize nullable properties to null #23

Closed
angelolloqui opened this issue Oct 19, 2017 · 1 comment
Closed

Initialize nullable properties to null #23

angelolloqui opened this issue Oct 19, 2017 · 1 comment
Labels

Comments

@angelolloqui
Copy link
Owner

In swift, nullable properties have a default value of nil. However, in Kotlin they need explicit initialization.

Example:

This Swift:

class PaymentSelectorPresenter {
    private var selectedPaymentMethod: PaymentMethod?
}

Translates to:

class PaymentSelectorPresenter {
    private var selectedPaymentMethod: PaymentMethod?
}

But should be:

class PaymentSelectorPresenter {
    private var selectedPaymentMethod: PaymentMethod? = null
}
@angelolloqui
Copy link
Owner Author

Fixed on 80fcbaa

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant