inko-lang / inko

A language for building concurrent software with confidence

Home Page:http://inko-lang.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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