Skip to content

Ensure sugared/structured arguments work with zip(). - #2001

Merged
grynspan merged 1 commit into
mainfrom
jgrynspan/zip2sequence-sugared-arg
Nov 1, 2026
Merged

grynspan merged 1 commit into
mainfrom
jgrynspan/zip2sequence-sugared-arg

Conversation

@grynspan

@grynspan grynspan commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

The current implementation of @Test for Zip2Sequence (the output of zip(_:_:)) has a bug that prevents it from accepting a single, un-desugared tuple argument:

@Test(arguments: zip(x, y))
func f(_ xy: (T, U)) { // 🛑 Cannot convert value of type 'nonisolated(nonsending) @Sendable ((T, U)) async throws -> Void' to expected argument type 'nonisolated(nonsending) @Sendable (T, U) async throws -> Void'
}

This PR adjusts the signature of the underlying helper function to ensure the above syntax works as intended.

Checklist:

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

The current implementation of `@Test` for `Zip2Sequence` (the output of `zip(_:_:)`) has a bug that prevents it from accepting a single, un-desugared tuple argument:

```swift
@test(arguments: zip(x, y))
func f(_ xy: (T, U)) { // ERROR
}
```

This PR adjusts the signature of the underlying helper function to ensure the above syntax works as intended.
@grynspan grynspan added this to the Swift 6.5.0 (main) milestone Nov 1, 2026
@grynspan grynspan self-assigned this Nov 1, 2026
@grynspan grynspan added bug 🪲 Something isn't working parameterized-testing Related to parameterized testing functionality macros 🔭 Related to Swift macros such as @Test or #expect labels Nov 1, 2026
@briancroom

Copy link
Copy Markdown
Contributor

Nice find!

@grynspan
grynspan merged commit 87ec972 into main Nov 1, 2026
32 of 37 checks passed
@grynspan
grynspan deleted the jgrynspan/zip2sequence-sugared-arg branch November 1, 2026 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug 🪲 Something isn't working macros 🔭 Related to Swift macros such as @Test or #expect parameterized-testing Related to parameterized testing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants