Skip to content

Operator Assignment Support#214

Open
rcosta358 wants to merge 1 commit intomainfrom
operator-assignments
Open

Operator Assignment Support#214
rcosta358 wants to merge 1 commit intomainfrom
operator-assignments

Conversation

@rcosta358
Copy link
Copy Markdown
Collaborator

Description

This PR adds support for Java operator assignments such as +=, -=, *=, /=, and %= in the refinement checking.
It works by modeling operator assignments as equivalent simple assignments: x += yx = x + y.

Example

@Refinement("_ > 0")
int plus(@Refinement("_ >= 0") int x) {
    x += 1; // x is now > 0
    return x;
}

Before we had an error in the return statement because the x += 1 was ignored. Now we don't.

Related Issue

None.

Type of change

  • Bug fix
  • New feature
  • Documentation update
  • Code refactoring

Checklist

  • Added/updated tests under liquidjava-example/src/main/java/testSuite/ (Correct* / Error*)
  • mvn test passes locally
  • Updated docs/README if behavior or API changed

@rcosta358 rcosta358 requested a review from CatarinaGamboa May 9, 2026 17:36
@rcosta358 rcosta358 self-assigned this May 9, 2026
@rcosta358 rcosta358 added the enhancement New feature or request label May 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant