leo icon indicating copy to clipboard operation
leo copied to clipboard

[Bug] can assign non-const values to const vars

Open 0rphon opened this issue 2 years ago • 0 comments

🐛 Bug Report

Code snippet to reproduce

function main(x: u8) -> u8 {
    const a: u8 = x;
    const b: u8 = a;
    let c: u8 = x;
    const d: u8 = c;
    return d;
}

Stack trace & error message

E:\Work\Aleo\leo-playground>leo\target\debug\leo.exe build
     Build Starting...
     Build Compiling main program... ("E:\\Work\\Aleo\\leo-playground\\src/main.leo")
     Build Complete
      Done Finished in 2 milliseconds

Your Environment

  • testnet3 commit 5b572278fb1edc94f17807222fe3b710e3ae9962

0rphon avatar Jun 21 '22 19:06 0rphon