Skip to content

Have DiscoverableAsTestContent enumeration produce some Sequence instead of AnySequence. #1122

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

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

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.

1 participant