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

Diktat should suggest to override equals and hashcode for Arrays #1869

Open
orchestr7 opened this issue Dec 16, 2023 · 0 comments
Open

Diktat should suggest to override equals and hashcode for Arrays #1869

orchestr7 opened this issue Dec 16, 2023 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@orchestr7
Copy link
Member

orchestr7 commented Dec 16, 2023

If you will do the following:

data class SimpleArray(val a: Array<Long>)

and after that will try to do something like

assertEquals(SimpleArray(arrayOf(1)), SimpleArray(arrayOf(1)))

you will obviously get false. But sometimes it's easy to forget it, when you are working with Lists for a long period of time (because Lists will work in Kotlin-like style in the same case).

@orchestr7 orchestr7 added the bug Something isn't working label Dec 16, 2023
@orchestr7 orchestr7 self-assigned this Dec 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant