提交 db5cf2c4 编写于 作者: M Martin Strecker

Refactored GetAllMethodSymbolsOfPartialParts and switch the ordering, so the...

Refactored GetAllMethodSymbolsOfPartialParts and switch the ordering, so the first element in the array is always the implementation.
上级 1bde0f15
......@@ -59,24 +59,20 @@ public static bool CompatibleSignatureToDelegate(this IMethodSymbol method, INam
/// </summary>
public static ImmutableArray<IMethodSymbol> GetAllMethodSymbolsOfPartialParts(this IMethodSymbol method)
{
if (method.PartialDefinitionPart == null && method.PartialImplementationPart == null)
{
return ImmutableArray.Create(method);
}
if (method.PartialDefinitionPart != null)
{
Debug.Assert(method.PartialDefinitionPart != method);
return ImmutableArray.Create(method.PartialDefinitionPart, method);
Debug.Assert(method.PartialImplementationPart == null && method.PartialDefinitionPart != method);
return ImmutableArray.Create(method, method.PartialDefinitionPart);
}
if (method.PartialImplementationPart != null)
else if (method.PartialImplementationPart != null)
{
Debug.Assert(method.PartialImplementationPart != method);
return ImmutableArray.Create(method, method.PartialImplementationPart);
return ImmutableArray.Create(method.PartialImplementationPart, method);
}
else
{
return ImmutableArray.Create(method);
}
throw ExceptionUtilities.Unreachable;
}
public static IMethodSymbol RenameTypeParameters(this IMethodSymbol method, IList<string> newNames)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册