Constant folding for expressions
yorickpeterse opened this issue · comments
Description
The DefineConstants
MIR pass applies constant folding to constant values, such that e.g. let A = 10 + 5
is turned into let A = 15
. We should extract this logic and use it for a constant folding pass that operates on expressions (= the contents of method bodies). This way expressions such as let a = 'foo' + 'bar'
are turned into let a = 'foobar'
.
Related work
No response