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: assert failure instead of semantic error #250

Open
tim-hoffman opened this issue Apr 3, 2024 · 1 comment
Open

Bug: assert failure instead of semantic error #250

tim-hoffman opened this issue Apr 3, 2024 · 1 comment
Assignees

Comments

@tim-hoffman
Copy link
Contributor

Input file (example.circom):

function foo(x, n) {
   return x < n;
}
component main = foo(2, 3);

Command:

cargo build --release
./target/release/circom example.circom

Outcome:

thread 'main' panicked at program_structure/src/program_library/program_archive.rs:78:9:
assertion failed: self.contains_template(template_name)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Expectation:
The input file contains an error, attempting to use a function as the main template. This should result in a semantic error with a helpful error message instead of just the rust assertion failure message.

@miguelis miguelis self-assigned this Apr 3, 2024
@clararod9
Copy link
Collaborator

Hi!

Thank you for reporting this issue, we solved it in our last release (circom 2.1.9).

Now the compiler returns the following error:

error[T2053]: Typing error found
  ┌─ "empty.circom":4:18
  │
4 │ component main = foo(2, 3);
  │                  ^^^^^^^^^ Invalid main component: the main component should be a template, not a function call or expression

Thank you for your help :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants