question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DocCommentId incorrect for a nested type of a generic class

See original GitHub issue

Originating 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:open
  • Created 4 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
joelmartinezcommented, Aug 8, 2019

@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.

0reactions
joelmartinezcommented, Aug 15, 2019

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 😃

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found