Skip to content

Fix Instance Variable Leak Between Methods - #276

Open
rcosta358 wants to merge 1 commit into
mainfrom
fix-270
Open

Fix Instance Variable Leak Between Methods#276
rcosta358 wants to merge 1 commit into
mainfrom
fix-270

Conversation

@rcosta358

Copy link
Copy Markdown
Collaborator

Description

Fixes #270.
Prevents instance variables from leaking between sibling methods by clearing them before checking a new method/constructor.

Example

int fibonacci(@Refinement("_ > 0") int n) {
    if (n == 1)
        return 1;
    else
        return fibonacci(n - 1) + fibonacci(n - 2); // Refinement Error
}

int factorial(@Refinement("_ > 0") int n) {
    return n * factorial(n - 1); // Refinement Error
}

Both invalid recursive calls are now reported.

Related Issue

#270.

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 self-assigned this Jul 27, 2026
@rcosta358 rcosta358 added the bug Something isn't working label Jul 27, 2026
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.

Instance Variables Leak Between Sibling Methods

1 participant