ConditionalAccessRequiresReadableProperty() static private method

ArgumentException with message like "Conditional access expressions require readable properties."
static private ConditionalAccessRequiresReadableProperty ( ) : Exception
return System.Exception
        public static ConditionalMemberCSharpExpression ConditionalProperty(Expression expression, PropertyInfo property)
        {
            RequiresCanRead(expression, nameof(expression));
            ContractUtils.RequiresNotNull(property, nameof(property));

            if (!property.CanRead)
            {
                throw Error.ConditionalAccessRequiresReadableProperty();
            }

            if (property.GetIndexParameters().Length != 0)
            {
                throw Error.ConditionalAccessRequiresReadableProperty();
            }

            if (property.GetGetMethod(true).IsStatic)
            {
                throw Error.ConditionalAccessRequiresNonStaticMember();
            }

            var type = expression.Type.GetNonNullReceiverType();

            if (!TypeUtils.IsValidInstanceType(property, type))
            {
                throw LinqError.PropertyNotDefinedForType(property, type);
            }

            return(ConditionalMemberCSharpExpression.Make(expression, property));
        }