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

fix: modify assert(x) span to cover entire statement #3177

Closed
wants to merge 1 commit into from

Conversation

TomAFrench
Copy link
Member

Description

Problem*

Resolves #3175

Summary*

This PR fixes #3175 but I'm not sure if it's exactly the route we want to go down in general. I'm now setting the span of the constraint's condition to cover the entire statement rather than purely the condition alone. This is consistent with how we handle assert_eq but feels like I'm misusing this.

Perhaps we should assign explicit spans to statements rather than relying on using the spans of their fields.

Documentation

  • This PR requires documentation updates when merged.

    • I will submit a noir-lang/docs PR.
    • I will request for and support Dev Rel's help in documenting this PR.

Additional Context

PR Checklist*

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

@TomAFrench TomAFrench changed the title fix: modify assert(x) span to covert entire statement fix: modify assert(x) span to cover entire statement Oct 16, 2023
@jfecher
Copy link
Contributor

jfecher commented Oct 17, 2023

Perhaps we should assign explicit spans to statements rather than relying on using the spans of their fields.

I'd be in favor of this approach

@TomAFrench TomAFrench closed this Oct 17, 2023
@TomAFrench TomAFrench deleted the tf/assert-span-cover branch October 17, 2023 20:26
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

Successfully merging this pull request may close these issues.

Incorrect opcode span generated for assertions
2 participants