Skip to content

Brillig: assertion failure message is lost when string is defined in variable #11017

@asterite

Description

@asterite

Aim

When this program is executed with nargo execute --force-brillig

fn main() {
    assert(false, "oops");
}

we get:

error: Assertion failed: oops
  ┌─ src/main.nr:2:12
  │
2 │     assert(false, "oops");
  │            -----

However, with this program:

fn main() {
    let oops = "oops";
    assert(false, oops);
}

we get:

error: Assertion failed
  ┌─ src/main.nr:3:12
  │
3 │     assert(false, oops);
  │            -----

Now how "oops" doesn't show up in the assertion failure message anymore.

This is blocking #10004

Expected Behavior

In the second case the assertion failure message "oops" should be shown.

Bug

The assertion message is lost.

To Reproduce

Workaround

None

Workaround Description

No response

Additional Context

No response

Project Impact

None

Blocker Context

No response

Nargo Version

No response

NoirJS Version

No response

Proving Backend Tooling & Version

No response

Would you like to submit a PR for this Issue?

None

Support Needs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    brilligUnconstrained functions / brillig IR

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions