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

&& || operator not short-circuit as C# did #114

Open
PingMyCat opened this issue Aug 17, 2021 · 2 comments
Open

&& || operator not short-circuit as C# did #114

PingMyCat opened this issue Aug 17, 2021 · 2 comments
Assignees
Labels

Comments

@PingMyCat
Copy link

x = 100;
if( false && (x=50) > 100 )
return 0;
return x;
// --------------------------//
x = 100;
if( true || (x=50) < 0 )
return x;
return 0;

the right part of "&&" "||" are still evaluated

@codingseb codingseb self-assigned this Aug 25, 2021
@codingseb codingseb added the bug label Aug 25, 2021
@codingseb
Copy link
Owner

Hello @PingMyCat. Thanks to reporting this issue and sorry for my late response.
I will look what I can do for this but it' looks tricky as it is link to issues #56 and #81.
So I don't know if it's possible to correct this bug without breaking others corrections.

I am also currently investigating the possibility to compile to expression tree. see(#58).
If I manage to make it work it should manage automatically this kind of issues.
The drawdown is that it's a big rewrite of ExpressionEvaluator so it take time, and a lot of functionalities that are based on the on the fly evaluation and duck typing need to be rewrite and/or manage/call differently.

@PingMyCat
Copy link
Author

PingMyCat commented Aug 25, 2021 via email

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

No branches or pull requests

2 participants