C# 10 nullable type "?" character display seems inconsistent in the Intellisense display of the XML documentation

Viewed 56

Consider the following code snippet:

/// <summary>
/// Serializes this <see cref="ICollection"/>? object to a <see cref="string?"/>, skipping nulls.
/// </summary>
/// <param name="val">The value to process.</param>
/// <param name="separator">Optional separator.</param>
/// <returns><see cref="string?"/>.</returns>
public static string? SerializeToString(this ICollection? val, string? separator = null)
{
    if (val is null)
        return null;

With reference to the XML documentation, with cref="ICollection?"/>, Intellisense will not display the ?, which is why I put it after the <see /> block.

However, with <see cref="string?"/>, it will display the ?.

<see cref="MatchCollection?"/> won't display the ?.

Two of these examples are classes, one is an interface.

I noticed the ? won't display with generics, such as public A[]? MyFunc().

What am I misunderstanding here?

0 Answers
Related