TryGetValue pattern with C# 8 nullable reference types
If you’re arriving at this a little late, like me, it turns out the .NET team addressed it through a bunch of parameter attributes like MaybeNullWhen(returnValue: true) in the System.Diagnostics.CodeAnalysis space which you can use for the try pattern. Returning a swift-style nullable reference type works well, but the try pattern lets you return things … Read more