I've got a .NET 8/C# 12 project with nullable references enabled and when I use BuilderGenerator on a class that has properties with nullable reference types, the generated builder becomes a source of compiler warnings:
FooDtoBuilder.g.cs(102,77): Warning CS8669 : The annotation for nullable reference types should only be used in code within a '#nullable' annotations context. Auto-generated code requires an explicit '#nullable' directive in source.
This seems to be a consequence of a combination of #nullable disable in the generated code and the keeping the ? suffix on data fields:
public System.Lazy<string?> BazProperty = new System.Lazy<string?>(() => default(string?));
I've got a .NET 8/C# 12 project with nullable references enabled and when I use BuilderGenerator on a class that has properties with nullable reference types, the generated builder becomes a source of compiler warnings:
This seems to be a consequence of a combination of
#nullable disable
in the generated code and the keeping the?
suffix on data fields:Can this be fixed somehow?