You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 9addae1
Browse filesBrowse the repository at this point in the historyBrowse files
Isolate deferred callback state from lambda creation (#386)
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.
Copy file name to clipboardExpand all lines: README.md
+7-1Lines changed: 7 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -61,6 +61,12 @@ socket.sendUrgentData(1); // State Refinement Error
61
61
socket.close();
62
62
```
63
63
64
+
Lambda bodies are checked separately from the code that creates them. Creating a lambda does not apply its state
65
+
transitions to captured objects. While checking the body, LiquidJava keeps declared refinements but forgets the current
66
+
state of mutable captures, since that state may change before invocation. Callback execution summaries are not supported:
67
+
a call such as `listener.run()` does not apply the lambda body's effects to its captures. Explicit return statements in
68
+
lambdas and state checks on captured `this`/`super` receivers also have incomplete contract handling.
69
+
64
70
### Ghosts
65
71
66
72
Finally, LiquidJava also provides ghost variables that are used to track additional information about the program state with the `@Ghost` annotation. These are also updated through the `@StateRefinement` annotation.
@@ -211,4 +217,4 @@ You can find out more about LiquidJava in the following resources:
0 commit comments