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

EIE fix short-circuiting #29

Open
SomeRanDev opened this issue Dec 23, 2024 · 2 comments
Open

EIE fix short-circuiting #29

SomeRanDev opened this issue Dec 23, 2024 · 2 comments

Comments

@SomeRanDev
Copy link
Owner

This will break lmao. HOW COULD I BE SO STUPID.

// This:
final array: Array<Int>;
if(array.length > 0 && if(array[0] > 100) { array[0] == 111; } else { true; }) {
   // bruh
}

// Gets converted to this:
var tempBool;
if(array[0] > 100) tempBool = array[0] == 111;
else tempBool = true;

if(array.length > 0 && tempBool) {
   // bruh
}
@SomeRanDev
Copy link
Owner Author

SomeRanDev commented Dec 23, 2024

It should be converted to(?):

var tempBool = array.length > 0;
if(tempBool) {
    if(array[0] > 100) tempBool = array[0] == 111;
    else tempBool = true;
}

if(tempBool) {
    // bruh
}

@neimanpinchas
Copy link

In other words, if the 2nd part of a binop need to be outlined, then we must outline the 1st too. this applies generally to all outlineing, not only EIAE.

Its not that stupid, some are saying that short circuting is stupid by itself, EIE besides its benefits is also not the norm, so its fair for 2 stupid things to cause a 3rd stupid thing.

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

No branches or pull requests

2 participants