CS1580 fired with a paramater that is generic and nullable (xml doc)

55 views Asked by At

I'm using VS2019 16.1.1 (in VS2017 15.9.12 this does not happen)

I have method with this definition:

public static bool HasValue<T>(this T? source) where T : struct

and in a xml doc I have this:

/// <summary>
/// Internally uses <see cref="TypeValidations.HasValue{T}(T?)"/>.
/// </summary>

In VS2019 this fires the error:

Error   CS1580  Invalid type for parameter T? in XML comment cref attribute: 'TypeValidations.HasValue{T}(T?)'

If I change the documentation to TypeValidations.HasValue{T}(Nullable{T}) now I got an analyzer error (SA1125) telling me that I should use the shorthand notation for nullable types.

Is there a "standard" way to refer to nullable types in the XML documentation that not generate an error in the analyzers or the compiler?

Edit: repo code

0

There are 0 answers