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

Why is EquatableMIxin marked as immutable? #193

Closed
BirjuVachhani opened this issue Dec 23, 2024 · 1 comment
Closed

Why is EquatableMIxin marked as immutable? #193

BirjuVachhani opened this issue Dec 23, 2024 · 1 comment
Assignees
Labels
question Further information is requested

Comments

@BirjuVachhani
Copy link

Some of my model holds mutable data and I need custom equality so I am using EquatableMixin on it but it seems that the mixin is marked immutable so the analyzer now shows a warning that my class is not immutable. Is there a way around this?

@felangel felangel self-assigned this Jan 2, 2025
@felangel
Copy link
Owner

felangel commented Jan 2, 2025

This is explained in the README:

Note: Equatable is designed to only work with immutable objects so all member variables must be final (This is not just a feature of Equatable - overriding a hashCode with a mutable value can break hash-based collections).

Hope that helps 👍

@felangel felangel closed this as completed Jan 2, 2025
@felangel felangel added the question Further information is requested label Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants