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

◆ Condition() [1/2]

static ConditionalExpression System.Linq.Expressions.Expression< TDelegate >.Condition ( Expression< TDelegate > test,
Expression< TDelegate > ifTrue,
Expression< TDelegate > ifFalse )
inlinestaticinherited

Definition at line 2325 of file Expression.cs.

2326 {
2330 if (test.Type != typeof(bool))
2331 {
2332 throw Error.ArgumentMustBeBoolean("test");
2333 }
2334 if (!TypeUtils.AreEquivalent(ifTrue.Type, ifFalse.Type))
2335 {
2336 throw Error.ArgumentTypesMustMatch();
2337 }
2338 return ConditionalExpression.Make(test, ifTrue, ifFalse, ifTrue.Type);
2339 }
static void RequiresCanRead(Expression expression, string paramName)
static bool AreEquivalent(Type t1, Type t2)
Definition TypeUtils.cs:664

References System.Dynamic.Utils.TypeUtils.AreEquivalent(), System.Linq.Expressions.Error.ArgumentMustBeBoolean(), System.Linq.Expressions.Error.ArgumentTypesMustMatch(), System.Linq.Expressions.ConditionalExpression.Make(), and System.Dynamic.Utils.ExpressionUtils.RequiresCanRead().

Referenced by System.Dynamic.ExpandoObject.MetaExpando.AddDynamicTestAndDefer(), System.Dynamic.ExpandoObject.MetaExpando.BindGetOrInvokeMember(), System.Dynamic.DynamicObject.MetaDynamic.BuildCallMethodWithResult< TBinder >(), System.Dynamic.DynamicObject.MetaDynamic.CallMethodNoResult< TBinder >(), System.Dynamic.DynamicObject.MetaDynamic.CallMethodReturnLast< TBinder >(), System.Linq.Expressions.Interpreter.LightCompiler.CompileSwitchExpression(), System.Linq.Expressions.Expression< TDelegate >.IfThen(), System.Linq.Expressions.Expression< TDelegate >.IfThenElse(), System.Linq.Expressions.BinaryExpression.ReduceUserdefinedLifted(), System.Runtime.CompilerServices.CallSiteBinder.Stitch< T >(), System.Linq.Expressions.Compiler.LambdaCompiler.TryEmitHashtableSwitch(), System.Linq.Expressions.ConditionalExpression.Update(), and System.Linq.EnumerableRewriter.VisitConditional().