Add #pragma warning disable to generated code headers - #33
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the FastCloner source generator output to suppress nullable-related compiler warnings emitted by generated code, reducing noise during consumer compilation.
Changes:
- Add
#pragma warning disableto the generated header in context-based generated files. - Add
#pragma warning disableto the generated header in per-type clone extension generated files.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/FastCloner.SourceGenerator/ContextCodeGenerator.cs | Adds a warning-suppression pragma to the generated context file header. |
| src/FastCloner.SourceGenerator/CloneCodeGenerator.cs | Adds a warning-suppression pragma to the generated clone extension file header. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
|
I'd rather generate warning free code, can you contribute an example of what currently generates warnings? |
|
Here's a small sample that generates the compilation warnings. Kind regards, Ingbert |
|
@IngbertPalm thanks for the repro, fixed in #34. I'll add you as co-author to one of the commits. |
The source code generated by FastCloner.SourceGenerator generates unnecessary CS8602 and CS8604 warnings during compilation.
Added lines to the generated source code to avoid warnings.