Repository navigation
Check current receiver typestate across loops - #384
Open
CatarinaGamboa wants to merge 1 commit into
Open
CatarinaGamboa wants to merge 1 commit into
CatarinaGamboa wants to merge 1 commit into
Conversation
rcosta358
approved these changes
Oct 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A state change inside a loop must not establish the receiver state after a loop that can run zero times. Main already havocs local receivers, but calls on explicit and implicit
thisskipped receiver state checking entirely. For example,while (n > 0) { this.mark(); n--; } this.reset();incorrectly passed.Initialize each instance method's receiver from its declared entry states, resolve current
thisand unqualifiedsuperthrough the same receiver predicate, and include that receiver in loop havoc. Qualified outer receivers retain their existing handling. State-preserving methods with multiple entry alternatives check the union of those preconditions, so a wrapper accepting either state can call another method accepting either state.Add passing and failing regressions for local receivers in while/for/foreach loops, explicit and implicit
this, later iterations, direct receiver calls, unconditional transitions after loops, and multiple state-preserving entry alternatives.Validation:
mvn -pl liquidjava-verifier test— 389 tests, zero failures or errors.Precision remains conservative: loops forget changed receiver state, and methods with alternative transitions that change state still require one applicable alternative to be provable. This change does not initialize constructor receivers or expand instance methods named
main.Closes #338.