GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Isolate deferred callback state from lambda creation by CatarinaGamboa · Pull Request #386 · liquid-java/liquidjava

Conversation

@CatarinaGamboa

@CatarinaGamboa CatarinaGamboa commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
CatarinaGamboa added 2 commits October 9, 2026 00:04
@CatarinaGamboa
Isolate deferred lambda state changes from callback creation
067cf95
@CatarinaGamboa
Preserve guards for blank primitive captures
b8f8120
rcosta358
rcosta358 approved these changes Oct 9, 2026
View reviewed changes

@rcosta358 rcosta358 left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. We should also update the "Verification Features" section in liquidjava-docs to explain this, as a follow up of #2.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@rcosta358 rcosta358 mentioned this pull request Oct 9, 2026
Document deferred callback verification behavior liquid-java/liquidjava-docs#8
Open
@CatarinaGamboa
CatarinaGamboa merged commit 9addae1 into main Oct 13, 2026
1 check passed

Uh oh!

There was an error while loading. Please reload this page.

@rcosta358
rcosta358 deleted the fix/341-callback-field-state branch October 13, 2026 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@rcosta358 rcosta358 rcosta358 approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Soundness: a call inside an anonymous class body changes the field state seen by other methods

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@CatarinaGamboa @rcosta358
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.