Skip to content

[Bug] Import usage in circuit functions #557

@howardwu

Description

@howardwu

🐛 Bug Report

Unable to use imported types in circuit functions.

Code snippet to reproduce

import core.unstable.blake2s.Blake2s;

circuit Foo {
    function foo() -> [u8; 32] {
        return Blake2s::hash([0u8; 32], [0u8; 32])
    }
}

function main(a: u32, b: u32) -> u32 {
    let x = Foo::foo();
    return 5
}

Stack trace & error message

     |
   5 |          return Blake2s::hash([0u8; 32], [0u8; 32])
     |                 ^^^^^^^
     |
     = Cannot find value `Blake2s` in this scope

Error: Crate("leo-compiler", "Program failed due to previous error")

(Write what you expected to happen here)

Your Environment

  • Leo v1.0.8

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions