Constant folding for expressions #691
Labels
compiler
Changes related to the compiler
feature
New things to add to Inko, such as a new standard library module
performance
Changes related to improving performance
Description
The
DefineConstants
MIR pass applies constant folding to constant values, such that e.g.let A = 10 + 5
is turned intolet 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 aslet a = 'foo' + 'bar'
are turned intolet a = 'foobar'
.Related work
No response
The text was updated successfully, but these errors were encountered: