Skip to content

Commit

Permalink
changed: LE.ParameterExpression back to array in LambdaExpression in …
Browse files Browse the repository at this point in the history
…regards to #116
  • Loading branch information
dadhi committed Aug 30, 2018
1 parent ab67cf8 commit f598e5d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/FastExpressionCompiler.LightExpression/Expression.cs
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,7 @@ public static Expression Divide(Expression left, Expression right) =>
new ArithmeticBinaryExpression(ExpressionType.Divide, left, right, left.Type);

public static BlockExpression Block(params Expression[] expressions) =>
new BlockExpression(expressions[expressions.Length - 1].Type,
Tools.Empty<ParameterExpression>(), expressions);
new BlockExpression(expressions[expressions.Length - 1].Type, Tools.Empty<ParameterExpression>(), expressions);

public static TryExpression TryCatch(Expression body, params CatchBlock[] handlers) =>
new TryExpression(body, null, handlers);
Expand Down Expand Up @@ -665,14 +664,14 @@ public class LambdaExpression : Expression

public Type ReturnType => Body.Type;
public readonly Expression Body;
public readonly IReadOnlyList<ParameterExpression> Parameters;
public readonly ParameterExpression[] Parameters;

public override SysExpr ToExpression() => ToLambdaExpression();

public System.Linq.Expressions.LambdaExpression ToLambdaExpression() =>
SysExpr.Lambda(Body.ToExpression(), Parameters.Map(p => p.ParamExpr));

internal LambdaExpression(Type delegateType, Expression body, IReadOnlyList<ParameterExpression> parameters)
internal LambdaExpression(Type delegateType, Expression body, ParameterExpression[] parameters)
{
Body = body;
Parameters = parameters;
Expand Down

0 comments on commit f598e5d

Please sign in to comment.