leo icon indicating copy to clipboard operation
leo copied to clipboard

[Bug] Leo generates invalid Aleo code for empty functions / closures

Open mikebenfield opened this issue 1 year ago • 0 comments

This Leo code:

program extraneous_lines.aleo {
    transition main() -> u32 {
        return f();
    }
    function f() -> u32 {
        return 0u32;
    }

Compiles to this Aleo code:

program extraneous_lines.aleo;
closure f:
    output 0u32 as u32;


function main:
    call f into r0;
    output r0 as u32.private;

which is invalid due to the closure not having any instructions.

mikebenfield avatar Oct 16 '24 21:10 mikebenfield