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.
For example:
how does generic code like Dictionary.TryGetValue deal with this?
bool TryGetValue(TKey key, [MaybeNullWhen(returnValue: false)] out TValue value); which means you get yelled at if you don't check for a true
// This is okay: if(myDictionary.TryGetValue("cheese", out var result)) { var more = result * 42; } // But this is not: _ = myDictionary.TryGetValue("cheese", out var result); var more = result * 42; // "CS8602: Dereference of a potentially null reference" Further details: