Repository navigation
Isolate deferred callback state from lambda creation - #386
Open
CatarinaGamboa wants to merge 2 commits into
Open
CatarinaGamboa wants to merge 2 commits into
CatarinaGamboa wants to merge 2 commits into
Conversation
rcosta358
approved these changes
Oct 9, 2026
Collaborator
There was a problem hiding this comment.
LGTM. We should also update the "Verification Features" section in liquidjava-docs to explain this, as a follow up of #2.
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.
Creating a lambda currently applies its body's state transitions to captured objects. For example,
Runnable later = () -> manager.addEdit(null); manager.undo();passes even though the callback may never run. Check lambda bodies in an isolated context so their assignments, branch facts, and try transitions do not change the surrounding execution.Forget invocation-time assumptions about mutable captures while preserving guards on effectively final primitive captures. Restore variable instances, shared refinements, paths, and enclosing try recorders even after a body diagnostic. The regressions cover local and field callbacks, nested lambdas, try/catch/finally, invalid bodies, primitive guards, and the anonymous-class reproducer already fixed by #326.
Callback invocation summaries remain unsupported:
listener.run()does not apply effects to its captures. Receiver-call checking and lambda return boundaries are handled separately by #384 and #385.Validation:
mvn test -pl liquidjava-verifier -am(389 tests, no failures) before the final blank-local capture precision adjustment. Both focused fixtures were rerun on the final code: the passing fixture verifies, including blank locals assigned before capture, and all seven expected failing-fixture diagnostic titles and positions match.Fixes #341.