// NotNullWhen indicates that a parameter is not null when the return value of a method is true or false.
// The annotation here indicates that when 'TryParseUser()' returns true, 'u' will always have a value assigned.
public bool TryParseUser(string userIdentifier, [NotNullWhen(true)] out User u) { /* ... */ }