Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add structural equality comparison to the LightExpression #431

Open
dadhi opened this issue Nov 10, 2024 · 0 comments
Open

Add structural equality comparison to the LightExpression #431

dadhi opened this issue Nov 10, 2024 · 0 comments
Assignees

Comments

@dadhi
Copy link
Owner

dadhi commented Nov 10, 2024

Given that we already have ToLambaExpression and after #271 we will have ToLightExpression.
Now we have possibility to convert the Light Expression from and to the System Expression.
The missing link is the ability to compare the restored expression.
This issue should address it.

Update
For now, we may compare the expressions converted to the C# code (which is not optimal):

#if LIGHT_EXPRESSION
        var sysExpr = expr.ToLambdaExpression();
        var restoredExpr = sysExpr.ToLightExpression();
        // todo: @feature #431 compare the restored target and source expressions directly instead of strings
        Assert.AreEqual(expr.ToCSharpString(), restoredExpr.ToCSharpString());
#endif

Update:

Take into account that when comparing the generated C# code, the generated names may be different based on the new expression identities. Because currently AppendName provides the unique name suffix based on the expression.GetHashCode()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant