提交 0a901949 编写于 作者: J Jason Malinowski

Add workaround to IMethodSymbolExtensions.RenameTypeParameters

This makes the extension method work again. The workaround is tracked by
https://github.com/dotnet/roslyn/issues/36093.
上级 dffce7fe
......@@ -86,7 +86,8 @@ public static IMethodSymbol RenameTypeParameters(this IMethodSymbol method, ILis
var updatedTypeParameters = RenameTypeParameters(
method.TypeParameters, newNames, typeGenerator);
var mapping = new Dictionary<ITypeSymbol, ITypeSymbol>();
// The use of AllNullabilityIgnoringSymbolComparer is tracked by https://github.com/dotnet/roslyn/issues/36093
var mapping = new Dictionary<ITypeSymbol, ITypeSymbol>(AllNullabilityIgnoringSymbolComparer.Instance);
for (int i = 0; i < method.TypeParameters.Length; i++)
{
mapping[method.TypeParameters[i]] = updatedTypeParameters[i];
......@@ -139,7 +140,9 @@ public static IMethodSymbol RenameTypeParameters(this IMethodSymbol method, ILis
// We generate the type parameter in two passes. The first creates the new type
// parameter. The second updates the constraints to point at this new type parameter.
var newTypeParameters = new List<CodeGenerationTypeParameterSymbol>();
var mapping = new Dictionary<ITypeSymbol, ITypeSymbol>();
// The use of AllNullabilityIgnoringSymbolComparer is tracked by https://github.com/dotnet/roslyn/issues/36093
var mapping = new Dictionary<ITypeSymbol, ITypeSymbol>(AllNullabilityIgnoringSymbolComparer.Instance);
for (int i = 0; i < typeParameters.Length; i++)
{
var typeParameter = typeParameters[i];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册