Skip to content

Replace fixture protocol in ConfirmationTests with an existential composition of parameterized protocols#1598

Merged
stmontgomery merged 3 commits intoswiftlang:mainfrom
stmontgomery:adopt-constrained-existential-with-protocol-composition
Mar 2, 2026
Merged

Replace fixture protocol in ConfirmationTests with an existential composition of parameterized protocols#1598
stmontgomery merged 3 commits intoswiftlang:mainfrom
stmontgomery:adopt-constrained-existential-with-protocol-composition

Conversation

@stmontgomery
Copy link
Contributor

This modifies a test fixture in ConfirmationTests now that both a Swift language limitation, and an associated runtime bug, have been resolved.

The original issue was that the language did not support writing any RangeExpression<Int> & Sequence<Int> & Sendable, but that was resolved in Swift 6.2 in swiftlang/swift#76705. Once that was resolved, it exposed a runtime bug which would crash when forming a collection of such existential types. That was fixed in swiftlang/swift#85346, and landed in Apple's 26.4 OSes (currently in beta).

This PR finally removes the workaround and writes this parameterized test the idiomatic way, using a collection whose element type is a composition of protocols where some are parameterized.

Checklist:

  • Code and documentation should follow the style of the Style Guide.
  • If public symbols are renamed or modified, DocC references should be updated.

@stmontgomery stmontgomery added this to the Swift 6.4.0 (main) milestone Feb 27, 2026
@stmontgomery stmontgomery self-assigned this Feb 27, 2026
@stmontgomery stmontgomery added the enhancement New feature or request label Feb 27, 2026
@stmontgomery stmontgomery added the build 🧱 Affects the project's build configuration or process label Feb 27, 2026
@stmontgomery stmontgomery added the tech-debt 💾 reduces technical debt label Feb 27, 2026
Copy link
Contributor

@grynspan grynspan left a comment

Choose a reason for hiding this comment

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

We only have 26.2 in CI so this change is untestable. Perhaps wait until we can verify it?

@stmontgomery stmontgomery requested a review from grynspan March 2, 2026 19:18
@stmontgomery stmontgomery merged commit d63cbd4 into swiftlang:main Mar 2, 2026
51 of 52 checks passed
@stmontgomery stmontgomery deleted the adopt-constrained-existential-with-protocol-composition branch March 2, 2026 19:38
grynspan added a commit that referenced this pull request Mar 3, 2026
…tial composition of parameterized protocols (#1598)"

This reverts commit d63cbd4.
grynspan added a commit that referenced this pull request Mar 3, 2026
Revert "Replace fixture protocol in ConfirmationTests with an existential composition of parameterized protocols (#1598)"

This reverts commit d63cbd4.

Resolves rdar://171579639.

### Checklist:

- [x] Code and documentation should follow the style of the [Style Guide](https://github.com/apple/swift-testing/blob/main/Documentation/StyleGuide.md).
- [x] If public symbols are renamed or modified, DocC references should be updated.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build 🧱 Affects the project's build configuration or process enhancement New feature or request tech-debt 💾 reduces technical debt

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants