Skip to content

Commit

Permalink
Review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
fakefeik committed Sep 10, 2019
1 parent 143c223 commit 8491360
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion GrobExp.Compiler.Tests/Test.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ public void TestNullable()
public void TestLambdaExpressionCreator()
{
Expression<Func<string, string>> e = x => x.Substring(1, 2);
LambdaExpressionCreator.Create<Func<string, string>>(e.Body, e.Parameters.ToArray());
var lambda = LambdaExpressionCreator.Create<Func<string, string>>(e.Body, e.Parameters.ToArray());
Assert.That(lambda.Compile()("abcd"), Is.EqualTo("bc"));
}

[Test]
Expand Down
2 changes: 1 addition & 1 deletion GrobExp.Compiler/LambdaExpressionCreator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ private static LambdaCreateDelegate BuildLambdaFactory(Type delegateType)
il.Ldarg(1);
il.Ldarg(2);
il.Ldarg(3);
il.Callnonvirt(resultType.GetMethods(BindingFlags.NonPublic | BindingFlags.Static).Single(x => x.Name == "Create"));
il.Callnonvirt(resultType.GetMethod("Create", BindingFlags.NonPublic | BindingFlags.Static));
il.Ret();
}
return (LambdaCreateDelegate)method.CreateDelegate(typeof(LambdaCreateDelegate));
Expand Down

0 comments on commit 8491360

Please sign in to comment.