private static UnaryExpression GetUserDefinedUnaryOperatorOrThrow(ExpressionType unaryType, string name, Expression operand)
{
UnaryExpression u = GetUserDefinedUnaryOperator(unaryType, name, operand);
if (u != null)
{
ValidateParamswithOperandsOrThrow(u.Method.GetParametersCached()[0].ParameterType, operand.Type, unaryType, name);
return u;
}
throw Error.UnaryOperatorNotDefined(unaryType, operand.Type);
}