You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Interestingly because OurCurrency is defined in a trait that is extended twice, ServiceA and ServiceB both end up with a freshly created instance of OurCurrency. This causes ServiceA.someMoney == ServiceB.otherMoney to be false in our tests!
We've fixed our specific case by overriding equals and hashcode in OurCurrency, but it might be something that should be Currency to avoid having to override it for every currency you define.
Thanks!
The text was updated successfully, but these errors were encountered:
Hello! We've hit some problems in our code when defining a currency in one of our base traits:
Interestingly because
OurCurrency
is defined in a trait that is extended twice,ServiceA
andServiceB
both end up with a freshly created instance ofOurCurrency
. This causesServiceA.someMoney == ServiceB.otherMoney
to be false in our tests!We've fixed our specific case by overriding equals and hashcode in
OurCurrency
, but it might be something that should beCurrency
to avoid having to override it for every currency you define.Thanks!
The text was updated successfully, but these errors were encountered: