Skip to content

Conversation

@ArquintL
Copy link
Member

@ArquintL ArquintL commented Jul 17, 2025

This PR resolves parsing ambiguities (that manifest, e.g., as a parse error at a let expression despite the actual error being much later in the program text) by renaming in to elem.
@reviewers: I've separated the changes in Gobra and the tests by placing them in different commits, which might help the reviewing process.

Verifying this program now results in the following error message:

func foo(ghost xs seq[int]) {
  assert 42 in xs
}
Error at: <file, line, column of 'in'> Unexpected 'in' encountered. Did you mean to use 'elem' denoting ghost collection containment?
  assert true in xs
              ^^

Supersedes #940
Closes #899

cc @ThomasMayerl

@ArquintL ArquintL requested a review from jcp19 July 17, 2025 12:41
@ArquintL ArquintL force-pushed the rename-in-to-elem branch from a66e20f to eaab549 Compare July 17, 2025 12:59
Copy link
Contributor

@jcp19 jcp19 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ArquintL ArquintL enabled auto-merge (squash) July 18, 2025 08:58
@ArquintL ArquintL merged commit f805530 into master Jul 18, 2025
3 of 6 checks passed
@ArquintL ArquintL deleted the rename-in-to-elem branch July 18, 2025 10:42
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.

Gobra reports let-in parser error if there is a parser error in another function

3 participants