reflaxe
reflaxe copied to clipboard
EIE fix short-circuiting
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
}
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
}
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.