7 ms·
.Net source generators can't modify existing code, they can only add additional code files, so your first example wouldn't be able to be rewritten by the source
by X-Cubed 5y ago
.Net source generators can't modify existing code, they can only add additional code files, so your first example wouldn't be able to be rewritten by the source generator.
You can read the development discussion and syntax reasoning in the GitHub issue: https://github.com/dotnet/runtime/issues/44676 https://github.com/dotnet/runtime/issues/44676