Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]Leo produces an error if the name of a valid project contains an underscore. #541

Closed
aleo-debugger opened this issue Jan 11, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@aleo-debugger
Copy link

🐛 Bug Report

Leo 1.0.7 produces an error if the name of a valid project contains an underscore. The compilation of such a project fails with the error “circuit Foo must be declared before it is used in an expression ” (see the static_false project in the screenshot). Exactly the same valid project, but with the name without the underscore (see the statictrue project in the screenshot) compiles without errors.

Steps to Reproduce

Code snippet to reproduce

//  project  static_false

circuit Foo {
    a: u32
}
 
function main(a: u32, b: u32) {
    let f = Foo{a: 0u32 };
}

Stack trace & error message

Waiting for 0 seconds, press CTRL+C to quit ...
 Compiling Starting...
 Compiling Compiling main program... ("c:\\Users\\test\\Aleo Studio\\static_false\\src/main.leo")
 Compiling     --> "c:\\Users\\test\\Aleo Studio\\static_false\\src/main.leo": 6:13
     |
   6 |      let f = Foo{a: 0u32 };
     |              ^^^^^^^^^^^^^
     |
     = circuit `Foo` must be declared before it is used in an expression

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

Expected Behavior

There should be no error

Your Environment

  • Leo 1.0.7
  • rust 1.48.0
  • Edition: Windows 10 Pro
    Version: 20H2
    OS build: 19042.685
    Experience: Windows Feature Experience Pack 120.2212.551.0

@aleo-debugger aleo-debugger added the bug Something isn't working label Jan 11, 2021
@howardwu
Copy link
Member

Project packages can only use dashes -. Underscores _ are forbidden.

Closing issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants