Skip to content

Fix Refinements After Early Return - #277

Merged
rcosta358 merged 1 commit into
mainfrom
fix-68
Aug 11, 2026
Merged

Fix Refinements After Early Return#277
rcosta358 merged 1 commit into
mainfrom
fix-68

Conversation

@rcosta358

Copy link
Copy Markdown
Collaborator

Description

Fixes #68.
Uses the canCompleteNormally method introduced in #210 to preserve the condition of the branch that continues after an early return.

Example

public static int divide(int a, @Refinement("b != 0") int b) {
    return a / b;
}

public static void divideUnlessZero(int x, int y) {
    if (y == 0) return;
    divide(x, y); // y != 0 on every reachable path
}

Related Issue

#68.

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 (not applicable; no API or documentation changes)

@rcosta358 rcosta358 self-assigned this Jul 27, 2026
@rcosta358 rcosta358 added the bug Something isn't working label Jul 27, 2026
@rcosta358
rcosta358 merged commit db07738 into main Aug 11, 2026
1 check passed
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

None yet

Development

Successfully merging this pull request may close these issues.

False Positive With Early Return

2 participants