DocCommentId incorrect for a nested type of a generic class
See original GitHub issueOriginating bug report on the .net core API docs: https://github.com/dotnet/dotnet-api-docs/issues/2854
To summarize, we start with this method signature:
public static ImmutableArray<TSource> ToImmutableArray<TSource>(this ImmutableArray<TSource>.Builder builder)
Compiler output is
M:System.Collections.Immutable.ImmutableArray.ToImmutableArray``1(System.Collections.Immutable.ImmutableArray{``0}.Builder)
and DocCommentId output is
M:System.Collections.Immutable.ImmutableArray.ToImmutableArray``1(System.Collections.Immutable.ImmutableArray`1.Builder{``0})
I verified it with the following minimal example:
public class Test<T> {
public class Builder {}
public static Test<T> ToTest (Test<T>.Builder b) => new Test<T> ();
}
which gives the following result
M:Mono.Cecil.Tests.Test`1.ToTest(Mono.Cecil.Tests.Test`1.Builder{`0})
Simple test case was written against the cecil master branch in the unit test project …
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (9 by maintainers)
Top Results From Across the Web
Can a generic class have a non-generic nested type?
Constraining a nested type to one particular outer type effectively makes the type non-generic. However, the outer type is still generic—you can ...
Read more >Nested generic in a generic class - java
Java requires that each generic type parameter be declared explicitly for good reason. Regardless of what it seems like to you, this is...
Read more >CA1006: Do not nest generic types in member signatures
To call a member whose signature contains a nested type argument, the user must instantiate one generic type and pass this type to...
Read more >Generic Methods - Java™ Tutorials
If a generic method appears inside a generic class, it's a good idea to avoid using the same names for the type parameters...
Read more >c# - Should I avoid nested generic collections?
Are there any other reasons to avoid nested generics? Or am I using them wrong? Does this use-case warrant a separate class? c#...
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

@jbevain I will if it’s not resolved by the time the original issue gets prioritized onto my plate ( 😉 @mimisasouvanh). Not 100% sure when that will be, but I’ll definitely need to resolve that at some point in the future … so I’m definitely up for working on it at that point.
lol, yeah … I’ll make sure to include a number of tests and scenarios once it’s implemented (while also double checking against the roslyn results). I don’t know exactly when I’ll finish this, but I’ll have a PR for you at some point 😃