Record-syntax issues #8
-
Consider the following case, using the new record-syntax from C# 9.0: public class A
{
/// <summary>
/// Int comment
/// </summary>
public int Int { get; set; }
}
/// <summary>
/// B documentation
/// </summary>
/// <param name="Int"><inheritdoc cref="A.Int"/></param>
public record B(int Int); With the current version (1.3.0) of
Ideally, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Looks like you have a couple of problems there... The first warning you've got ( The second issue you have is that you're trying to inherit a Changing the above and using the latest C# compiler results in no errors and the following output: <?xml version="1.0" encoding="utf-8"?>
<doc>
<members>
<member name="P:A.Int">
<summary>
Int comment
</summary>
</member>
<member name="T:B">
<summary>
B documentation
</summary>
<param name="Int">
Int comment
</param>
</member>
<member name="M:B.#ctor(System.Int32)">
<summary>
B documentation
</summary>
<param name="Int">
Int comment
</param>
</member>
</members>
</doc> |
Beta Was this translation helpful? Give feedback.
Looks like you have a couple of problems there...
The first warning you've got (
CS1574
) is from the C# compiler, saying it can't resolve thecref
. When that happens, the identifier in the comment is prefixed with!:
(as defined in the spec), which then means InheritDocTask can't resolve the reference. I am unable to reproduce that with the .NET6 RC1 SDK, so that would appear to be a Roslyn bug that has been resolved.The second issue you have is that you're trying to inherit a
summary
into aparam
. You must give an explicit path in this case so that you reach into the content of the summary, which would make that doc line<param name="Int"><inheritdoc cref="A.Int" path="/summary/node()"/>…