It's awesome to see NativeAOT support landing in .NET 7. That will be a big win for those who want to use NativeAOT for smaller binaries and faster startup time. This Twitter thread from David Fowler does a good job of summarizing the pros and cons of NativeAOT:
.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.
https://twitter.com/davidfowl/status/1391580410119819265