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: incomplete span on failed assertions (elaborator) #5523

Closed
Thunkar opened this issue Jul 16, 2024 · 0 comments · Fixed by #5624
Closed

bug: incomplete span on failed assertions (elaborator) #5523

Thunkar opened this issue Jul 16, 2024 · 0 comments · Fixed by #5624
Assignees
Labels
bug Something isn't working

Comments

@Thunkar
Copy link
Contributor

Thunkar commented Jul 16, 2024

Aim

When retrieving errors from failed assertions, the legacy mode used to point to the whole failed expression. Now using the elaborator some parts are missing, which permeates all the way to the e2e tests in aztec-packages:

Screenshot 2024-07-16 at 16 26 21

Note the squiggly line misses the exclamation mark when using the elaborator.

Expected Behavior

A failed assertion should point to the whole failed statement, without skipping operators.

Bug

The code snippet in the assertion is incomplete.

To Reproduce

fn main(test: bool) {
    assert(!test, "Blablabla!");
}

Prover.toml

test = true

Project Impact

Nice-to-have

Impact Context

It's not a blocker, but it certainly makes things very confusing by providing incorrect context on errors.

Workaround

None

Workaround Description

No response

Additional Context

No response

Installation Method

Compiled from source

Nargo Version

No response

NoirJS Version

No response

Would you like to submit a PR for this Issue?

None

Support Needs

No response

@Thunkar Thunkar added the bug Something isn't working label Jul 16, 2024
@asterite asterite self-assigned this Jul 29, 2024
github-merge-queue bot pushed a commit that referenced this issue Jul 29, 2024
# Description

## Problem

Resolves #5523

## Summary

The span of a Prefix expression was taken from its prefixed expression
instead of from the entire expression.

## Additional Context

I'm not sure how to test this 🤔 

## Documentation\*

Check one:
- [x] No documentation needed.
- [ ] Documentation included in this PR.
- [ ] **[For Experimental Features]** Documentation to be submitted in a
separate PR.

# PR Checklist\*

- [x] I have tested the changes locally.
- [x] I have formatted the changes with [Prettier](https://prettier.io/)
and/or `cargo fmt` on default settings.
github-merge-queue bot pushed a commit that referenced this issue Jul 29, 2024
# Description

## Problem

Resolves #5523

## Summary

The span of a Prefix expression was taken from its prefixed expression
instead of from the entire expression.

## Additional Context

I'm not sure how to test this 🤔 

## Documentation\*

Check one:
- [x] No documentation needed.
- [ ] Documentation included in this PR.
- [ ] **[For Experimental Features]** Documentation to be submitted in a
separate PR.

# PR Checklist\*

- [x] I have tested the changes locally.
- [x] I have formatted the changes with [Prettier](https://prettier.io/)
and/or `cargo fmt` on default settings.
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
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants