ArgumentOutOfRange when processing a nested type of a generic type
KirillOsenkov opened this issue · comments
String.Substring Line 1282 | |
---|---|
TypeNameHelper.GetTypeNameForGenericType Line 65 | |
ValueTupleResolvedParameter.AppendTypeName Line 23 | |
ResolvedParameter.Append Line 34 | |
ResolvedMethod.Append Line 93 | |
EnhancedStackTrace.Append Line 103 | |
EnhancedStackTrace.ToString Line 84 |
The exception is here:
The type in question is:
Roslyn.Utilities.MultiDictionary
2+ValueSet[Microsoft.CodeAnalysis.Document,System.ValueTuple2[Microsoft.CodeAnalysis.ISymbol,Microsoft.CodeAnalysis.FindSymbols.Finders.IReferenceFinder]]
http://sourceroslyn.io/#Microsoft.CodeAnalysis/InternalUtilities/MultiDictionary.cs,b9e522a001545166
Even though the type is a generic type, the name is just ValueSet
and doesn't contains the backtick.
Here's a PR that adds a unit-test:
#110
It is significant that the method parameter type is a nested type of a generic type where the generic type parameter is a value tuple with named parameters.
Basically the logic for value tuples needs to be aware of nested types of generic types that themselves don't have a backtick in the name:
Ben.Demystifier/src/Ben.Demystifier/ValueTupleResolvedParameter.cs
Lines 23 to 26 in 0f17b30
Released a new version that doesn't have this issue; though not sure it makes it a sensible type name, looking into that