本文整理汇总了C#中Microsoft.CodeAnalysis.CSharp.Symbols.MethodSymbol.Construct方法的典型用法代码示例。如果您正苦于以下问题:C# MethodSymbol.Construct方法的具体用法?C# MethodSymbol.Construct怎么用?C# MethodSymbol.Construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.CodeAnalysis.CSharp.Symbols.MethodSymbol
的用法示例。
在下文中一共展示了MethodSymbol.Construct方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddReducedAndFilteredMethodGroupSymbol
// Reduce extension methods to their reduced form, and remove:
// a) Extension methods are aren't applicable to receiverType
// including constraint checking.
// b) Duplicate methods
// c) Methods that are hidden or overridden by another method in the group.
private static bool AddReducedAndFilteredMethodGroupSymbol(
ArrayBuilder<MethodSymbol> methods,
ArrayBuilder<MethodSymbol> filteredMethods,
MethodSymbol method,
ImmutableArray<TypeSymbol> typeArguments,
TypeSymbol receiverType)
{
MethodSymbol constructedMethod;
if (!typeArguments.IsDefaultOrEmpty && method.Arity == typeArguments.Length)
{
constructedMethod = method.Construct(typeArguments);
Debug.Assert((object)constructedMethod != null);
}
else
{
constructedMethod = method;
}
if ((object)receiverType != null)
{
constructedMethod = constructedMethod.ReduceExtensionMethod(receiverType);
if ((object)constructedMethod == null)
{
return false;
}
}
// Don't add exact duplicates.
if (filteredMethods.Contains(constructedMethod))
{
return false;
}
methods.Add(method);
filteredMethods.Add(constructedMethod);
return true;
}