lucasteles / Strongly

💪🏾 A strongly-typed domain values source-generator
MIT License
35 stars 6 forks source link

Fix for New() and Empty-field on record struct #6

Closed skattegard closed 11 months ago

skattegard commented 11 months ago

When using record struct, the New() method and the Empty public field was removed when cleaning up the baseDef.

I parse the Empty declaration, and New() declaration if present, and inserted before the constructor. So they wouldnt be removed later in the process.

I moved some of the methods in the (TYPENAME)_base.cs classes, so that the Empty field could serve as a delimiter on what to keep in the baseDef.

I also added some "dummy" test to see that the Empty and New() is generated correctly.

lucasteles commented 11 months ago

Looks good