Skip to content

[Merge] Add isolated next for AsyncMerge2Sequence#441

Open
julianiaccopucci wants to merge 1 commit into
apple:mainfrom
julianiaccopucci:fix-merge-typed-failure
Open

[Merge] Add isolated next for AsyncMerge2Sequence#441
julianiaccopucci wants to merge 1 commit into
apple:mainfrom
julianiaccopucci:fix-merge-typed-failure

Conversation

@julianiaccopucci

@julianiaccopucci julianiaccopucci commented Jun 30, 2026

Copy link
Copy Markdown

Summary

  • Add an explicit next(isolation:) implementation to AsyncMerge2Sequence.Iterator.
  • Add Swift 6 availability-gated regression tests for mixed throwing and non-throwing merge inputs in both argument orders.

Motivation

Swift 6 async iteration can call next(isolation:). Without an explicit implementation, AsyncMerge2Sequence.Iterator can fall back to the standard-library compatibility bridge through legacy next(). For mixed throwing and non-throwing inputs, that bridge can force-cast an upstream error to Never and trap.

This is related to #391.

Test plan

  • swift test --filter TestMerge2Isolation
  • Temporarily removing next(isolation:) reproduces the Failure to Never cast crash in TestMerge2Isolation.
  • swift test

Avoid the Swift 6 default next(isolation:) bridge so mixed throwing and non-throwing merge inputs propagate upstream failures instead of trapping.
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.

1 participant