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

warning in fields generator #176

Open
joprice opened this issue Aug 1, 2024 · 1 comment
Open

warning in fields generator #176

joprice opened this issue Aug 1, 2024 · 1 comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@joprice
Copy link

joprice commented Aug 1, 2024

When running with optional warnings enabled such as <WarnOn>FS3560;..., the following warning shows up in the code generated by the fields generator:

This copy-and-update record expression changes all fields of record type 'Example.Test1'. Consider using the record construction syntax instead. [3560]

When combined with <TreatWarningsAsErrors>true</TreatWarningsAsErrors>, it causes the build to fail, requiring setting <WarningsNotAsErrors>FS3560</WarningsNotAsErrors> or to disable the warning altogether.

Since all fields are updated, is there any reason to use the with syntax, and just provide all fields instead?

If that's tricky for whatever reason, could a nowarn be added to the generated file to silence the warning?

I'm not sure how valuable this warning is, and might disable it altogether, but perhaps other generators would have the same issue, and providing a parameter to disable warnings would make sense as well.

@7sharp9
Copy link
Collaborator

7sharp9 commented Aug 2, 2024

Happy to accept a PR if you want to change the AST or add the nowarn. Not sure which is easier. The idea is the generated code doesnt matter how you style it so formating etc doesnt really matter.

@7sharp9 7sharp9 added help wanted Extra attention is needed good first issue Good for newcomers labels Aug 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants