CS1584, CS1658 from `inheritdoc cref` when referencing method with value tuple parameter
See original GitHub issueWhen <inheritdoc cref="..."/>
refers to a member with a parameter whose type is a ValueTuple intrinsic, the completion list will help select the member while typing the cref attribute’s value, but then C# will emit several warnings around the xml being invalid and the member not being found.
using System;
public class C {
/// <param name="progress"><inheritdoc cref="M2(IProgress{int})" path="/param[@name='progress']" /></param>
public void M(IProgress<int> progress) {
}
/// <param name="progress">Some progress</param>
private void M2(IProgress<int> progress) {
}
/// <param name="progress"><inheritdoc cref="N(IProgress{(int,int)})" path="/param[@name='progress']" /></param>
public void N(IProgress<int> progress) {
}
/// <param name="progress">Some progress</param>
private void N2(IProgress<(int,int)> progress) {
}
}
Expected
no warnings
Actual
warning CS1584: XML comment has syntactically incorrect cref attribute 'N(IProgress{(int,int)})'
warning CS1658: Identifier expected. See also error CS1001.
warning CS1658: Syntax error, '>' expected. See also error CS1003.
warning CS1658: ) expected. See also error CS1026.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:6 (2 by maintainers)
Top Results From Across the Web
How to use `<inheritdoc cref="...">` when one of ...
when one of the parameters have the `in` keyword? ... Is it possible to use inheritdoc referencing a method with an in parameter?...
Read more >Using the <inheritdoc /> Tag
Be aware that when <param> tags are inherited, the parameter's name in your class's member must match the base member's parameter name. If...
Read more >Tuple Trouble: Why C# Tuples Get to Break the Guidelines
Technically, System.ValueTuple<…> is a family of data types of the same name, but of varying arity (specifically, the number of type parameters). What's ......
Read more >Cannot Convert The Literal '2 To The Expected Type 'edm.guid'.
Consider changing the 'Embed Interop Types' property on either assembly. CS1763, Error, '{0}' is of type '{1}'. A default parameter value of a...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I solved this by removing the argument types in the cref, e.g.
to
Which has the advantage of being significantly easier to read - though doesn’t work when there are multiple overrides.
Yes, this is a possible workaround but docfx doesn’t work with it for me.