ConditionalReceiverTypeMismatch() 정적인 개인적인 메소드

ArgumentException with message like "Type '{0}' of the receiver expression is not compatible with non-null type '{1}' of the conditional receiver."
static private ConditionalReceiverTypeMismatch ( object p0, object p1 ) : Exception
p0 object
p1 object
리턴 System.Exception
        internal static void CheckConditionalAccess(Expression receiver, ConditionalReceiver nonNullReceiver, Expression whenNotNull)
        {
            RequiresCanRead(receiver, nameof(receiver));
            RequiresNotNull(nonNullReceiver, nameof(nonNullReceiver));
            RequiresCanRead(whenNotNull, nameof(whenNotNull));

            var receiverType = receiver.Type;

            if (receiverType == typeof(void) || receiverType.IsByRef || (receiverType.IsValueType && !receiverType.IsNullableType()))
            {
                throw Error.InvalidConditionalReceiverExpressionType(receiverType);
            }

            var nonNullReceiverType = receiverType.GetNonNullReceiverType();

            if (nonNullReceiverType != nonNullReceiver.Type)
            {
                throw Error.ConditionalReceiverTypeMismatch(receiverType, nonNullReceiverType);
            }
        }