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

◆ MakeCatchBlock()

static CatchBlock System.Linq.Expressions.Expression< TDelegate >.MakeCatchBlock ( Type type,
ParameterExpression< TDelegate >? variable,
Expression< TDelegate > body,
Expression< TDelegate >? filter )
inlinestaticinherited

Definition at line 2301 of file Expression.cs.

2302 {
2304 ContractUtils.Requires(variable == null || TypeUtils.AreEquivalent(variable.Type, type), "variable");
2305 if (variable == null)
2306 {
2307 TypeUtils.ValidateType(type, "type");
2308 }
2309 else if (variable.IsByRef)
2310 {
2311 throw Error.VariableMustNotBeByRef(variable, variable.Type, "variable");
2312 }
2313 ExpressionUtils.RequiresCanRead(body, "body");
2314 if (filter != null)
2315 {
2317 if (filter.Type != typeof(bool))
2318 {
2319 throw Error.ArgumentMustBeBoolean("filter");
2320 }
2321 }
2322 return new CatchBlock(type, variable, body, filter);
2323 }
static void Requires([DoesNotReturnIf(false)] bool precondition, string paramName)
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 bool AreEquivalent(Type t1, Type t2)
Definition TypeUtils.cs:664

References System.Dynamic.Utils.TypeUtils.AreEquivalent(), System.Linq.Expressions.Error.ArgumentMustBeBoolean(), System.Dynamic.Utils.ContractUtils.Requires(), System.Dynamic.Utils.ExpressionUtils.RequiresCanRead(), System.Dynamic.Utils.ContractUtils.RequiresNotNull(), System.type, System.Dynamic.Utils.TypeUtils.ValidateType(), and System.Linq.Expressions.Error.VariableMustNotBeByRef().

Referenced by System.Linq.Expressions.Expression< TDelegate >.Catch(), System.Linq.Expressions.Expression< TDelegate >.Catch(), System.Linq.Expressions.Expression< TDelegate >.Catch(), System.Linq.Expressions.Expression< TDelegate >.Catch(), System.Linq.Expressions.Compiler.StackSpiller.RewriteTryExpression(), System.Linq.Expressions.CatchBlock.Update(), System.Linq.Expressions.Interpreter.QuoteInstruction.ExpressionQuoter.VisitCatchBlock(), and System.Runtime.CompilerServices.RuntimeOps.ExpressionQuoter.VisitCatchBlock().