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

Equatable structs should not include type inheritance #110

Closed
angelolloqui opened this issue Mar 21, 2020 · 1 comment
Closed

Equatable structs should not include type inheritance #110

angelolloqui opened this issue Mar 21, 2020 · 1 comment

Comments

@angelolloqui
Copy link
Owner

An Equatable struct does not need to implement Equatable in Kotlin since dataclasses are already equatable by default.

This code:

struct User: Equatable {    
    var id: Int? = 0
    var name: String?
}

must be translated to:

data class User(
    var id: Int? = 0,
    var name: String? = null) {}

Instead of:

data class User(
    var id: Int? = 0,
    var name: String? = null): Equatable {}
@angelolloqui angelolloqui changed the title Equatable struts should not include type inheritance Equatable structs should not include type inheritance Mar 21, 2020
@angelolloqui
Copy link
Owner Author

Fixed with #109

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

No branches or pull requests

1 participant