Skip to content

Conversation

@dolio
Copy link
Contributor

@dolio dolio commented Oct 28, 2025

This fixes a bug in the runtime implementation of calling continuations.

There was missing logic related to the continuation having captured pending arguments. In the Yield case there is logic that looks for these, and applies a function result to the pending arguments. This was missing from the continuation call case, which should behave similarly (because a continuation call is implemented as 'push captured continuation back and yield arguments').

It's apparently tricky to actually get into situations that actually trigger the previously bad logic. I think usually it is covered by the logic for Yield, because the continuation happens to have also captured a frame that just Yields its argument. However, we have an example of a more complicated situation that triggers the old bug, included in a test case here.

Fixes #5947.

dolio added 2 commits October 28, 2025 11:48
When continuations with captured pending arguments were called, it
was possible to have situations that discarded those arguments,
similar to an erroneous `yield`. There is explicit logic in the latter
to apply the yielded result to the pending arguments that was absent
in the continuation case. This adds comparable logic to the
continuation call.
@dolio
Copy link
Contributor Author

dolio commented Oct 28, 2025

Base tests pass.

@dolio dolio requested a review from ceedubs October 28, 2025 18:00
@ceedubs
Copy link
Contributor

ceedubs commented Oct 28, 2025

I'll run the cloud integration tests with this.

Copy link
Contributor

@ceedubs ceedubs left a comment

Choose a reason for hiding this comment

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

Oops forgot to send an update right away, but cloud integration tests pass

@pchiusano pchiusano merged commit 7cba328 into trunk Oct 28, 2025
1 check passed
@pchiusano pchiusano deleted the fix/ability-overapp branch October 28, 2025 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Usage of Each induces a Unison Runtime error: SetAff called with bad handler reference

4 participants