Skip to content

Conversation

@grynspan
Copy link
Contributor

@grynspan grynspan commented May 22, 2025

This PR changes how DiscoverableAsTestContent enumeration works so that we can return some Sequence instead of AnySequence. We do so by removing the ~Copyable constraint on the protocol, which subsequently causes the compiler to get confused and crash trying to represent some Sequence<TestContentRecord<T>> where T: DiscoverableAsTestContent.

The only supported/allowed consumers of the DiscoverableAsTestContent protocol are Swift Testing and the experimental Playgrounds package, neither of which uses (or needs to use) a move-only type here. Earlier, ExitTest conformed to DiscoverableAsTestContent, but this was changed and is no longer necessary.

Checklist:

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

…instead of `AnySequence`.

This PR changes how `DiscoverableAsTestContent` enumeration works so that we can return `some Sequence` instead of `AnySequence`. We do so by removing the `~Copyable` constraint on the protocol, which subsequently causes the compiler to get confused and crash trying to represent `some Sequence<TestContentRecord<T>>` where `T: DiscoverableAsTestContent`.
@grynspan grynspan added this to the Swift 6.x milestone May 22, 2025
@grynspan grynspan self-assigned this May 22, 2025
@grynspan grynspan added enhancement New feature or request performance 🏎️ Performance issues discovery 🔎 test content discovery labels May 22, 2025
@grynspan grynspan changed the title Have DiscoverableAsTestContent enumeration produce some Sequence Have DiscoverableAsTestContent enumeration produce some Sequence instead of AnySequence. May 22, 2025
@grynspan
Copy link
Contributor Author

@swift-ci test

@grynspan grynspan marked this pull request as ready for review June 10, 2025 21:03
@grynspan grynspan merged commit 61a01cb into main Jun 12, 2025
3 checks passed
@grynspan grynspan deleted the jgrynspan/discoverableastestcontent-anysequence branch June 12, 2025 23:34
@stmontgomery stmontgomery modified the milestones: Swift 6.x, Swift 6.2 Jun 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

discovery 🔎 test content discovery enhancement New feature or request performance 🏎️ Performance issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants