"Null-Correctness Assisting Attributes: MaybeNull"

// MaybeNull applied to a return element indicates that the returned value may be null.
// This is useful when working with generics, as 'T?' isn't always valid.

[return: MaybeNull]
public T GetElementByName<T>(string name) { /* ... */ }


Code snippet taken from "Two Decades of C#: A Reference - C# 8".