Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Nov 27, 2023

Conversation

skattegard
Copy link
Contributor

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.

@skattegard skattegard marked this pull request as draft November 21, 2023 12:37
@skattegard skattegard marked this pull request as ready for review November 21, 2023 12:37
@skattegard skattegard marked this pull request as draft November 22, 2023 06:19
@skattegard skattegard closed this Nov 22, 2023
@skattegard skattegard reopened this Nov 22, 2023
@lucasteles
Copy link
Owner

Looks good

@lucasteles lucasteles marked this pull request as ready for review November 27, 2023 15:17
@lucasteles lucasteles merged commit 28e8d55 into lucasteles:master Nov 27, 2023
1 check passed
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.

3 participants