nponeccop / HNC

HN Compiler
GNU Lesser General Public License v3.0
62 stars 5 forks source link

Optimization of context1.hn drops arguments #48

Closed nponeccop closed 9 years ago

nponeccop commented 11 years ago

HN source:

foo y = {
    ap foo bar = sum y (foo bar)
    t4 x = sum x y
    t3 x = ap t4 x
    t3 5
}

Actual output:

foo y = {
    t4 x = sum x y
    sum y t4
}

t4 lacks an argument. The code below is correct partial inlining:

foo y = {
    t4 x = sum x y
    sum y (t4 5)
}

Expected output:

foo y = sum y (sum 5 y)
nponeccop commented 9 years ago

Works as expected now