SteveDunn / Vogen

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

Add option to opt out of primitive comparison #611

Closed aradalvand closed 1 month ago

aradalvand commented 1 month ago

Describe the feature

Hey there. Great library. Thanks for the efforts.

The behavior described in #561 is one that many of us would ideally like to avoid; as it seems to partly undermine the type-safety that value objects are all about in the first place (even if you find that arguable, there's still a reasonable argument to be made).

So, please introduce an option (e.g. noPrimitiveComparison = true) that allows those of us who want to prevent such comparisons at compile-time to opt out of this default behavior.

SteveDunn commented 1 month ago

Hi @aradalvand , thanks for the feedback. This makes perfect sense. I'll do this shortly.

SteveDunn commented 1 month ago

This will be in the next release