本文整理汇总了C#中TypeMap.SubstituteType方法的典型用法代码示例。如果您正苦于以下问题:C# TypeMap.SubstituteType方法的具体用法?C# TypeMap.SubstituteType怎么用?C# TypeMap.SubstituteType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TypeMap
的用法示例。
在下文中一共展示了TypeMap.SubstituteType方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReturnTypesMatch
private static bool ReturnTypesMatch(MethodSymbol candidateMethod, TypeMap candidateMethodTypeMap, ref ParamInfo targetReturnParam)
{
TypeSymbol candidateReturnType = candidateMethod.ReturnType;
TypeSymbol targetReturnType = targetReturnParam.Type;
// CONSIDER: Do we want to add special handling for error types? Right now, we expect they'll just fail to match.
if (candidateMethodTypeMap.SubstituteType(candidateReturnType) != targetReturnType)
{
return false;
}
if (!CustomModifiersMatch(candidateMethod.ReturnTypeCustomModifiers, targetReturnParam.CustomModifiers))
{
return false;
}
return true;
}
示例2: SubstituteType
internal static TypeSymbol SubstituteType(TypeMap typeMap, TypeSymbol typeSymbol)
{
return typeMap == null ? typeSymbol : typeMap.SubstituteType(typeSymbol);
}
示例3: ParametersMatch
private static bool ParametersMatch(ParameterSymbol candidateParam, TypeMap candidateMethodTypeMap, ref ParamInfo targetParam)
{
// This could be combined into a single return statement with a more complicated expression, but that would
// be harder to debug.
if ((candidateParam.RefKind != RefKind.None) != targetParam.IsByRef)
{
return false;
}
// CONSIDER: Do we want to add special handling for error types? Right now, we expect they'll just fail to match.
if (candidateMethodTypeMap.SubstituteType(candidateParam.Type) != targetParam.Type)
{
return false;
}
if (!CustomModifiersMatch(candidateParam.CustomModifiers, targetParam.CustomModifiers))
{
return false;
}
return true;
}