Skip to content

fix: compare records with == in objectsEquals - #216

Open
AzazelSensei wants to merge 1 commit into
felangel:masterfrom
AzazelSensei:fix-211-record-num-equality
Open

fix: compare records with == in objectsEquals#216
AzazelSensei wants to merge 1 commit into
felangel:masterfrom
AzazelSensei:fix-211-record-num-equality

Conversation

@AzazelSensei

Copy link
Copy Markdown

Status

READY

Breaking Changes

NO

Description

objectsEquals compared runtimeType before == for records. (value: 1) == (value: 1.0) is true in Dart, but NumInRecord((value: 1)) == NumInRecord((value: 1.0)) was false.

Use == for records, same as the snippet on #211.

Related PRs

branch PR
master #211

Todos

  • Tests
  • Documentation
  • Examples

Steps to Test or Reproduce

dart test test/equatable_utils_test.dart

Impact to Remaining Code Base

This PR will affect:

  • Equatable / mixin props that are records containing nums

Dart record equality already treats 1 and 1.0 as equal. The
runtimeType check after that made NumInRecord((value: 1)) !=
NumInRecord((value: 1.0)).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant