Skip to content

Commit

Permalink
Merge pull request #10 from skbkontur/net-core-fixes
Browse files Browse the repository at this point in the history
net-core-fixes
  • Loading branch information
fakefeik authored Sep 25, 2019
2 parents f88485b + c668015 commit 143e838
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
6 changes: 3 additions & 3 deletions GrobExp.Compiler.Tests/GrobExp.Compiler.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.0.1" />
<PackageReference Include="NUnit" Version="3.11.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.13.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
<PackageReference Include="NUnit" Version="3.12.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.15.1" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)'=='net45'">
Expand Down
8 changes: 8 additions & 0 deletions GrobExp.Compiler.Tests/Test.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ public void TestNullable()
func(null);
}

[Test]
public void TestLambdaExpressionCreator()
{
Expression<Func<string, string>> e = x => x.Substring(1, 2);
var lambda = LambdaExpressionCreator.Create<Func<string, string>>(e.Body, e.Parameters.ToArray());
Assert.That(lambda.Compile()("abcd"), Is.EqualTo("bc"));
}

[Test]
public void TestRefParameter()
{
Expand Down
2 changes: 1 addition & 1 deletion GrobExp.Compiler/GrobExp.Compiler.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="GrEmit" Version="3.1.1" />
<PackageReference Include="GrEmit" Version="3.2.1" />
</ItemGroup>

</Project>
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.Newobj(resultType.GetConstructors(BindingFlags.NonPublic | BindingFlags.Instance).Single());
il.Callnonvirt(resultType.GetMethod("Create", BindingFlags.NonPublic | BindingFlags.Static));
il.Ret();
}
return (LambdaCreateDelegate)method.CreateDelegate(typeof(LambdaCreateDelegate));
Expand Down
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://raw.githubusercontent.com/AArnott/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
"version": "1.2",
"version": "1.3",
"assemblyVersion": {
"precision": "build"
},
Expand Down

0 comments on commit 143e838

Please sign in to comment.