private void CheckForConditionalMethodError(EXPR pExpr)
{
Debug.Assert(pExpr.isCALL());
if (pExpr.isCALL())
{
// This mimics the behavior of the native CompilerSymbolLoader in GetConditionalSymbols. Override
// methods cannot have the conditional attribute, but implicitly acquire it from their slot.
EXPRCALL call = pExpr.asCALL();
MethodSymbol method = call.mwi.Meth();
if (method.isOverride)
{
method = method.swtSlot.Meth();
}
object[] conditions = method.AssociatedMemberInfo.GetCustomAttributes(typeof(ConditionalAttribute), false).ToArray();
if (conditions.Length > 0)
{
throw Error.BindCallToConditionalMethod(method.name);
}
}
}