diff --git a/src/DelegateDecompiler/OptimizeExpressionVisitor.cs b/src/DelegateDecompiler/OptimizeExpressionVisitor.cs index 106a388a..96331bc2 100644 --- a/src/DelegateDecompiler/OptimizeExpressionVisitor.cs +++ b/src/DelegateDecompiler/OptimizeExpressionVisitor.cs @@ -460,7 +460,7 @@ protected override Expression VisitMethodCall(MethodCallExpression node) { if (node.Method.Name == nameof(Expression.Constant) && node.Method.DeclaringType == typeof(Expression) && - node.Arguments[0] is Expression parameter) + node.Arguments[0] is ParameterExpression parameter) { return Expression.Constant(parameter); } diff --git a/test.cmd b/test.cmd index 9596647f..2a985241 100644 --- a/test.cmd +++ b/test.cmd @@ -4,11 +4,11 @@ nunit3-console ^ src\DelegateDecompiler.Tests\bin\Release\net45\DelegateDecompiler.Tests.dll ^ src\DelegateDecompiler.Tests.VB\bin\Release\net45\DelegateDecompiler.Tests.VB.dll ^ src\DelegateDecompiler.EntityFramework.Tests\bin\Release\net45\DelegateDecompiler.EntityFramework.Tests.dll ^ - --result=DelegateDecompiler.testsresults.xml;format=AppVeyor + --result=DelegateDecompiler.testsresults.xml;format=AppVeyor && ^ -dotnet test --no-build -c Release -f netcoreapp3.1 src\DelegateDecompiler.Tests -dotnet test --no-build -c Release -f netcoreapp3.1 src\DelegateDecompiler.Tests.VB -dotnet test --no-build -c Release -f netcoreapp3.1 src\DelegateDecompiler.EntityFramework.Tests -dotnet test --no-build -c Release -f netcoreapp3.1 src\DelegateDecompiler.EntityFrameworkCore.Tests -dotnet test --no-build -c Release -f netcoreapp3.1 src\DelegateDecompiler.EntityFrameworkCore3.Tests +dotnet test --no-build -c Release -f netcoreapp3.1 src\DelegateDecompiler.Tests && ^ +dotnet test --no-build -c Release -f netcoreapp3.1 src\DelegateDecompiler.Tests.VB && ^ +dotnet test --no-build -c Release -f netcoreapp3.1 src\DelegateDecompiler.EntityFramework.Tests && ^ +dotnet test --no-build -c Release -f netcoreapp3.1 src\DelegateDecompiler.EntityFrameworkCore.Tests && ^ +dotnet test --no-build -c Release -f netcoreapp3.1 src\DelegateDecompiler.EntityFrameworkCore3.Tests && ^ dotnet test --no-build -c Release -f net5.0 src\DelegateDecompiler.EntityFrameworkCore5.Tests