SteveDunn / Vogen

A semi-opinionated library which is a source generator and a code analyser. It Source generates Value Objects
Apache License 2.0
782 stars 46 forks source link

Inaccurate explanation for why there are no to-primitive implicit operators by default #660

Closed aradalvand closed 6 days ago

aradalvand commented 3 weeks ago

Describe the bug

The README says:

image

This is actually inaccurate. age1 == osVersion working is not a consequence of the to-primitive implicit operator alone, it's a consequence of the combination of that AND the primitive equality operators that Vogen generates by default — which you can now disable (#611), and this means that the following combination of options doesn't have the age1 == osVersion problem mentioned in the README:

[assembly: VogenDefaults(
    toPrimitiveCasting: CastOperator.Implicit,
    primitiveEqualityGeneration: PrimitiveEqualityGeneration.Omit
)]

image

Steps to reproduce

-

Expected behaviour

Up to you what should be done with this information :D At least perhaps consider updating that bit of the README to actually communicate this fact. Thank you!

SteveDunn commented 3 weeks ago

Good point! Thanks for highlighting that! I shall update the documentation to reflect the fact that equality is driven by more than one thing.

SteveDunn commented 6 days ago

Thank you, I've updated the documentation in the FAQ page