-
-
Notifications
You must be signed in to change notification settings - Fork 93
Open
Description
Description
ToCSharpString() generates invalid output when converting boolean equality expressions.
ToString: (x.MyTestBool == True)
ToCSharpString: (x.MyTestBool;
Example
using System.Linq.Expressions;
using FastExpressionCompiler;
var input = new TestClass() { MyTestBool = true };
var parameter = Expression.Parameter(input.GetType(), "x");
var property = Expression.Property(parameter, nameof(TestClass.MyTestBool));
var exp = Expression.Equal(property, Expression.Constant(true));
Console.WriteLine(exp.ToString()); // => (x.MyTestBool == True)
Console.WriteLine(exp.ToCSharpString()); // => (x.MyTestBool;
public class TestClass
{
public required bool MyTestBool { get; set; }
}e-i-n-s
Metadata
Metadata
Assignees
Labels
No labels