You add PolySharp to your source generator project to get back some of the modern C# features. https://github.com/Sergio0694/PolySharp