Repository navigation
Conversation
Lower producer try/with to RuntimeAsyncSequenceHelpers.EnumerateTryWith, a new FSharp.Core compiler-services helper. The source, filter and handler become independent runtime-async iterators driven with the enumeration's cancellation token, so awaits are allowed in the protected body, filters and handlers. The source is disposed before the handler runs. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Generated sequence types no longer re-implement IAsyncEnumerator directly, so interface calls dispatch through GeneratedRuntimeAsyncSequenceBase. The base rejects a second MoveNextAsync, or a DisposeAsync, while a move is pending. The generated MoveNextAsync releases the guard from a finally block through CompleteMoveNext, before its result completes. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Replace the runtime-async test fixtures' sample builders with copies of the reference async2 (cancellable), runtimeTask and asyncSeq2 builders and their test suites. The producer/consumer asyncSeq builder and its tests are removed; asyncSeq2 covers async sequences through __runtimeAsyncSequence, including stack-safe yield! and YieldFromFinal handoff. Tests share the builders through withSampleBuilders. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
✅ Release notes checked
|
Bring back RuntimeAsyncEnumerableTests (try/with, tail recursion, pull-driven and concurrent MoveNext coverage), now running on asyncSeq2. asyncSeq2 accepts F# Async as a cold source that receives the enumeration token. New builder tests cover cancellation, unmatched exceptions escaping try/with unwrapped, and deep non-tail yield!. The MergeSources overlap test checks start order with gated awaitables instead of elapsed time. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…ders in their folder Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Replace the FSharp.Core EnumerateTryWith helper with in-machine handling: - MoveNextAsync catches faults and re-enters the jump table, which routes each state to its innermost pending finally or handler, so bodies, guards, handlers and finally blocks can all await. - DisposeAsync sets a disposing flag and runs MoveNextAsync once more to execute pending finally blocks, skipping handlers. - GeneratedRuntimeAsyncSequenceBase implements DisposeAsync; generated types override a sync Close instead. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Remove the Seq.collect fallback. Non-delayed sources are enumerated inside the protected region, and filters that the handler does not already encode run before the handler. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
|
🔍 Tooling Safety Check — Affects-Compiler-Output
|
T-Gro
left a comment
There was a problem hiding this comment.
🤖 🕵️ AI review — verify independently.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
@majocha : I will want to backport some bug fixes (also w.r.t to runtime async) to net11 GA. Since this touches many relevant lines, I will delay merging this one until the fixes are ported (to make them portable), and only merge after. WDYT? |
|
Yes, I have no objections. The whole thing is very much a preview feature and my main concern is to keep it as self-contained as possible and not to break something unrelated. |
Description
try/with: in the protected body, inwhenfilters, and inhandlers. The source is disposed before the handler runs.
MoveNextAsyncor aDisposeAsyncwhile a move is still pending now throwsInvalidOperationExceptioninstead of corrupting the state machine.async2,runtimeTask, andasyncSeq2sample builders.asyncSeq2shows stack-safeyield!and aYieldFromFinaltail handoff built on the compiler feature.Fixes # (issue, if applicable)
Checklist