Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ ConvertChecked() [2/2]

static UnaryExpression System.Linq.Expressions.Expression< TDelegate >.ConvertChecked ( Expression< TDelegate > expression,
Type type,
MethodInfo? method )
inlinestaticinherited

Definition at line 5306 of file Expression.cs.

5307 {
5310 TypeUtils.ValidateType(type, "type");
5311 if (method == null)
5312 {
5313 if (expression.Type.HasIdentityPrimitiveOrNullableConversionTo(type))
5314 {
5315 return new UnaryExpression(ExpressionType.ConvertChecked, expression, type, null);
5316 }
5317 if (expression.Type.HasReferenceConversionTo(type))
5318 {
5319 return new UnaryExpression(ExpressionType.Convert, expression, type, null);
5320 }
5322 }
5324 }
static void RequiresNotNull(object value, string paramName)
static void RequiresCanRead(Expression expression, string paramName)
static void ValidateType(Type type, string paramName)
Definition TypeUtils.cs:695
static UnaryExpression GetUserDefinedCoercionOrThrow(ExpressionType coercionType, Expression expression, Type convertToType)
static UnaryExpression GetMethodBasedCoercionOperator(ExpressionType unaryType, Expression operand, Type convertToType, MethodInfo method)

References System.Linq.Expressions.Expression< TDelegate >.GetMethodBasedCoercionOperator(), System.Linq.Expressions.Expression< TDelegate >.GetUserDefinedCoercionOrThrow(), System.Dynamic.Utils.ExpressionUtils.RequiresCanRead(), System.Dynamic.Utils.ContractUtils.RequiresNotNull(), System.type, and System.Dynamic.Utils.TypeUtils.ValidateType().