mvdan / goreduce

Reduce Go programs
BSD 3-Clause "New" or "Revised" License
216 stars 7 forks source link

cleanup: inline blocks #7

Closed mvdan closed 7 years ago

mvdan commented 7 years ago

This is step 1 towards inlining func/method calls.

The tricky bit is scopes - if a block's scope and its parent have any colliding names, they need rewriting.

mvdan commented 7 years ago

Actually, this is safe for sure, so it can be a cleanup step.

mvdan commented 7 years ago

On second thoughts, shortcuts aren't safe as they might stop triggering compiler bugs and even change the runtime behaviour.

This is now done as a rule.