nponeccop / HNC

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

"foo = whileF ..." shouldn't be inlined #76

Open nponeccop opened 8 years ago

nponeccop commented 8 years ago

e.g.

foo = whileF bar baz quux
zorro foo

cannot be replaced with

zorro (whileF bar baz quux)

as loop return value becomes anonymous

The bug is reproduced in opt/allDigits.hn

https://github.com/nponeccop/HNC/blob/91b270a98d3df5e48bffd31eaf33d698c1b5a5da/HN/Optimizer/SimpleAlias.hs#L22