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

◆ Convert() [2/2]

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

Definition at line 5285 of file Expression.cs.

5286 {
5289 TypeUtils.ValidateType(type, "type");
5290 if (method == null)
5291 {
5292 if (expression.Type.HasIdentityPrimitiveOrNullableConversionTo(type) || expression.Type.HasReferenceConversionTo(type))
5293 {
5294 return new UnaryExpression(ExpressionType.Convert, expression, type, null);
5295 }
5297 }
5299 }
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().