If source generator projects must target netstandard2.0 (C# 7.3), how and why do the examples in the .NET 6 incremental generator documentation use C# 9 syntax like static anonymous functions?
From the doc, formatted for width:
IncrementalValuesProvider<AdditionalText> textFiles =
context.AdditionalTextsProvider.Where(static file =>
file.Path.EndsWith(".txt"));
Just change the C# version in the .csproj file to 9, as in <LangVersion>9.0</LangVersion>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With