In many cases, partial evaluation is only possible conditionally, and it is desirable to fork based on that condition, in order to produce optimized code for the consequent path.
Currently, this does not work if an abstract value is set to top:
let x = __abstract("number", "7");
let f = __abstract(":number", "foo");
if (x === 7) {
global.result = x + 5;
} else {
global.result = foo(x);
}
...produces:
(function () {
var _$1_global = this;
var _2_ = 7;
if (7 === _2_) {
_$1_global.result = 5 + _2_;
} else {
var _$0_derived = foo(_2_);
_$1_global.result = _$0_derived;
}
}).call(this);
In many cases, partial evaluation is only possible conditionally, and it is desirable to fork based on that condition, in order to produce optimized code for the consequent path.
Currently, this does not work if an abstract value is set to top:
...produces: