Parameter Packs embedded types and structured concurrency - bug or holding it wrong?

I've been playing with parameter packs in Xcode 15 beta 7 and have come across a crash and I'm not sure if its because I've found a bug or I'm holding parameter packs wrong. I've got a single function in an API client which looks like the following and works fine:

func request<R: Resource>(_ resource: R) async throws -> R.R.T { ... }

I'm adding a parameter pack version (just to experiment) which looks like this and calls the above function for each Resource it's given:

func requestMultiple<each R: Resource>(_ resource: repeat each R) async throws -> (repeat (each R).R.T) { ... }

To see if it works I wrote a unit tests which passes in 3 resources - the first one runs fine without any issue, but then when it comes to the second one it crashes. The stack trace just points to my code without any more information.

In the screen shot you can see in the logs that the first request is made and completes successfully, but when it attempts to run the second resource it crashes.

I suppose there is an error here in one way or another. Either I'm being allowed to do something which I'm not supposed to be able to do, or I've encountered a valid crash. My question is; which one is it?

Since this doesn't seem to have had much of a response I've filed a radar: FB13087344

I have the same problem using Beta 8

1 Like

I've just tested this again on Xcode 15.1 and the issue still persists.