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

◆ BlockCore()

static BlockExpression System.Linq.Expressions.Expression< TDelegate >.BlockCore ( Type type,
ReadOnlyCollection< ParameterExpression< TDelegate > > variables,
ReadOnlyCollection< Expression< TDelegate > > expressions )
inlinestaticprivateinherited

Definition at line 2203 of file Expression.cs.

2204 {
2205 ValidateVariables(variables, "variables");
2206 if (type != null)
2207 {
2208 if (expressions.Count == 0)
2209 {
2210 if (type != typeof(void))
2211 {
2212 throw Error.ArgumentTypesMustMatch();
2213 }
2214 return new ScopeWithType(variables, expressions, type);
2215 }
2218 {
2219 throw Error.ArgumentTypesMustMatch();
2220 }
2222 {
2223 return new ScopeWithType(variables, expressions, type);
2224 }
2225 }
2226 return expressions.Count switch
2227 {
2228 0 => new ScopeWithType(variables, expressions, typeof(void)),
2229 1 => new Scope1(variables, expressions[0]),
2230 _ => new ScopeN(variables, expressions),
2231 };
2232 }
static bool AreEquivalent(Type t1, Type t2)
Definition TypeUtils.cs:664
static bool AreReferenceAssignable(Type dest, Type src)
Definition TypeUtils.cs:673
static void ValidateVariables(ReadOnlyCollection< ParameterExpression > varList, string collectionName)

References System.Dynamic.Utils.TypeUtils.AreEquivalent(), System.Dynamic.Utils.TypeUtils.AreReferenceAssignable(), System.Linq.Expressions.Error.ArgumentTypesMustMatch(), System.Collections.Generic.Dictionary< TKey, TValue >.Count, System.type, and System.Linq.Expressions.Expression< TDelegate >.ValidateVariables().

Referenced by System.Linq.Expressions.Expression< TDelegate >.Block(), System.Linq.Expressions.Expression< TDelegate >.Block(), and System.Linq.Expressions.Expression< TDelegate >.GetOptimizedBlockExpression().