// System.Linq.Expressions.Expression
[__DynamicallyInvokable]
public Expression ReduceAndCheck()
{
if (!this.CanReduce)
{
throw Error.MustBeReducible();
}
Expression expression = this.Reduce();
if (expression == null || expression == this)
{
throw Error.MustReduceToDifferent();
}
if (!TypeUtils.AreReferenceAssignable(this.Type, expression.Type))
{
throw Error.ReducedNotCompatible();
}
return expression;
}
// System.Linq.Expressions.Expression
[__DynamicallyInvokable]
public virtual Expression Reduce()
{
if (this.CanReduce)
{
throw Error.ReducibleMustOverrideReduce();
}
return this;
}
ReduceAndCheck中先判断CanReduce,为true则向下执行,随即调用Reduce,再次判断CanReduce,为false则向下执行,那么问题来了,无论CanReduce为True或False,都会抛出异常?