using System;
#nullable enable
public interface ITest
{
/// <summary>
/// Some text.
/// </summary>
public void TestMethod<T>(T? obj);
}
public class Test : ITest
{
/// <inheritdoc cref="ITest.TestMethod{T}(T?)" />
public void TestMethod<T>(T? obj)
{
}
}
Expected Behavior:
No warnings
Actual Behavior:
A compiler warning CS1574 appears, stating that the given reference method in cref cannot be found.
But navigating to the interface works and hovering with the mouse even shows a tooltip with the correct summary.
I'll have to check what are the rules for nullable annotations in xml docs, but from quick experimentation I noticed that removing the ? annotation in the xml doc solves the problem (sharplab).
Version Used: VS 17.5.3, C#11
Steps to Reproduce:
See SharpLab
Expected Behavior: No warnings Actual Behavior: A compiler warning CS1574 appears, stating that the given reference method in
cref
cannot be found. But navigating to the interface works and hovering with the mouse even shows a tooltip with the correct summary.