Skip to content

Equality definition #7

@cvb941

Description

@cvb941

Hello,

I have noticed that the equals function on Measure class returns true even when the units of two measurements are different.

This is how Swift defines equality in their Measurement too.

However, I have encountered an issue with this implementation using Compose, where my UI is not recomposed when changing units.

I wonder whether it is correct or not to consider the units in the equality function. Was there a particular decision for the current implementation?

If equals were to include the units in the comparison, we could still use the compareTo as an alternative for the old behaviour.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions