# Let's talk about parameter packs

**URL:** <https://forums.swift.org/t/lets-talk-about-parameter-packs/83683>\
**Category:** Compiler\
**Tags:** compiler, parameter-packs\
**Created:** [December 12, 2025, 2:15am UTC](https://forums.swift.org/t/lets-talk-about-parameter-packs/83683 "2025-12-12T02:15:23Z")\
**Posts on this page:** 1\
**Showing post:** 15

<div class="post-metadata">

**Author:** ![twof](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/twof/32/1628_2.png) [@twof](https://forums.swift.org/u/twof)\
**Post date:** [May 13, 2026, 6:34pm UTC](https://forums.swift.org/t/lets-talk-about-parameter-packs/83683/15 "2026-05-13T18:34:33Z")

</div>

Hello again. I'm going to close out each of those issues. I've just opened up a PR with a suite of 24 tests that surface crashes, bugs, or limits within parameter packs. I'll also be making a post, hopefully today, with a project that provides a real use case that triggers each of these bugs.

> <https://github.com/swiftlang/swift/pull/89113>
>
> \## Summary
> 
> Bundles 24 regression tests covering parameter-pack bugs that still …reproduce on \`main\` (survey commit \`f0d8239caee\`). Each test is its own commit, so individual tests can be cherry-picked, dropped, or fixed up independently. Each test's full lit failure log is linked as a gist below.
> 
> Tests were derived from a fork branch where 26 tests were originally added alongside compiler fixes. Each test was applied alone onto a clean checkout of \`origin/main\` and run against a freshly-built \`main\` toolchain (\`--bootstrapping=hosttools --darwin-deployment-version-osx=14.0\`, lit \`variant\_triple\` patched to \`arm64-apple-macosx14.0\`). 24 of 26 still fail; the other 2 already pass on \`main\` and are not included here.
> 
> \### Already fixed on \`main\` (excluded)
> 
> \- \`test/Concurrency/sendnonsendable\_tasklocal\_crash.swift\` — was a SendNonSendable region-analysis assertion crash on \`release/6.3\`; passes on \`main\`.
> \- \`test/SILGen/variadic\_generic\_closure\_pack\_arg.swift\` — was a SILGenProlog crash on \`release/6.3\`; passes on \`main\`.
> 
> \### Failure breakdown on \`main\`
> 
> | Category | Count | What it means |
> |---|---|---|
> | \`compiler-crash\` | 15 | swift-frontend crashes (assertion failure or unreachable executed). |
> | \`enum-pack-rejected\` | 4 | enum declarations using type parameter packs are rejected with \`enums cannot declare a type pack\`. |
> | \`runtime-dealloc-bug\` | 2 | runtime aborts with deallocation-order error (\`freed pointer was not the last allocation\` or equivalent). |
> | \`diagnostic-mismatch\` | 2 | expected diagnostics not produced (or extra/unexpected diagnostics produced) for a pack-using construct. |
> | \`compile-error\` | 1 | compiler emits an error for code that should compile. |
> 
> \### Tests
> 
> | # | Category | Test | Headline | Log |
> |---|---|---|---|---|
> | 1 | \`compiler-crash\` | \`test/IRGen/keypath\_parameter\_pack.swift\` | Assertion failed: (metadata.GenericPackArguments.empty() && "We don't support packs here yet"), function operator(), file GenProto.cpp, line 4773. | \[gist\](https://gist.github.com/alex-reilly-dd/c09f7df225ad12cb298e64db6c1c69d1) |
> | 2 | \`compiler-crash\` | \`test/IRGen/round-trip-debug-types-pack-expansion.swift\` | Crash (no assertion): While emitting IR SIL function "@$s4main7MachineC2fnACyxxQp\_QPGys8Sendable\_pSg\_xxQp\_tntc\_tcfc". | \[gist\](https://gist.github.com/alex-reilly-dd/867d96ce301cac30542b961523708923) |
> | 3 | \`compiler-crash\` | \`test/Interpreter/keypath\_parameter\_pack.swift\` | Assertion failed: (metadata.GenericPackArguments.empty() && "We don't support packs here yet"), function operator(), file GenProto.cpp, line 4773. | \[gist\](https://gist.github.com/alex-reilly-dd/27749296d1df3ea9b0fac56c39a803e2) |
> | 4 | \`compiler-crash\` | \`test/Interpreter/keypath\_parameter\_pack\_generic.swift\` | Assertion failed: (metadata.GenericPackArguments.empty() && "We don't support packs here yet"), function operator(), file GenProto.cpp, line 4773. | \[gist\](https://gist.github.com/alex-reilly-dd/8ee64aeec5a385acbf645bb6be6aaf05) |
> | 5 | \`compiler-crash\` | \`test/Interpreter/variadic\_generic\_closure\_pack\_expansion.swift\` | Assertion failed: (!tupleTy.containsPackExpansionType() && "can't extract elements from tuples containing pack expansions " "right now"), function extractElements, file RValue.cpp, line 707. | \[gist\](https://gist.github.com/alex-reilly-dd/734fd5950fed7ba4fff955afbdb49e9d) |
> | 6 | \`compiler-crash\` | \`test/Interpreter/variadic\_generic\_pack\_owned\_tuple.swift\` | Assertion failed: (!tupleTy.containsPackExpansionType() && "can't extract elements from tuples containing pack expansions " "right now"), function extractElements, file RValue.cpp, line 707. | \[gist\](https://gist.github.com/alex-reilly-dd/4d4ba6a6c82cd5a580f30d7977fcf054) |
> | 7 | \`compiler-crash\` | \`test/Interpreter/variadic\_generic\_tuple\_init.swift\` | Crash (no assertion): While verifying SIL function "@$s4main17ThrowingContainerVACyxxQp\_QPGyKcfC". | \[gist\](https://gist.github.com/alex-reilly-dd/e4611c092c5be2625f53b960b4675441) |
> | 8 | \`compiler-crash\` | \`test/Profiler/coverage\_isolated\_deinit\_skipped\_body.swift\` | Assertion failed: (Bits.ApplyExpr.ThrowsIsSet), function throws, file Expr.h, line 5014. | \[gist\](https://gist.github.com/alex-reilly-dd/e23d9dd87b2df3e76d69523e0f6d8fae) |
> | 9 | \`compiler-crash\` | \`test/SILGen/pack\_closure\_parameter\_crash.swift\` | Assertion failed: (origPackType.matchesPack(substPackType)), function PackElementGenerator, file AbstractionPattern.cpp, line 938. | \[gist\](https://gist.github.com/alex-reilly-dd/532e1b7b865b14bc8d02dc3b43774a61) |
> | 10 | \`compiler-crash\` | \`test/SILGen/pack\_element\_member\_capture.swift\` | Assertion failed: (!getDeclContext()-\>isLocalContext() && "not a global variable!"), function isLazilyInitializedGlobal, file Decl.cpp, line 8396. | \[gist\](https://gist.github.com/alex-reilly-dd/4d538fff46052bee5385f3149af08c77) |
> | 11 | \`compiler-crash\` | \`test/SILGen/pack\_expansion\_multi\_tuple.swift\` | Assertion failed: (!tupleTy.containsPackExpansionType() && "can't extract elements from tuples containing pack expansions " "right now"), function extractElements, file RValue.cpp, line 707. | \[gist\](https://gist.github.com/alex-reilly-dd/611c808fb3cd634c6e01a59d3a7ba170) |
> | 12 | \`compiler-crash\` | \`test/SILGen/pack\_expansion\_tuple\_to\_closure.swift\` | Assertion failed: (!tupleTy.containsPackExpansionType() && "can't extract elements from tuples containing pack expansions " "right now"), function extractElements, file RValue.cpp, line 707. | \[gist\](https://gist.github.com/alex-reilly-dd/5f3dd38ec924e574a327df8370372deb) |
> | 13 | \`compiler-crash\` | \`test/SILGen/variadic\_generic\_closures\_pack\_expansion\_arg\_crash.swift\` | Assertion failed: (!tupleTy.containsPackExpansionType() && "can't extract elements from tuples containing pack expansions " "right now"), function extractElements, file RValue.cpp, line 707. | \[gist\](https://gist.github.com/alex-reilly-dd/1f4e557f5f038ff53ed0ac12be8ea942) |
> | 14 | \`compiler-crash\` | \`test/SILOptimizer/definite\_init\_variadic\_generics.swift\` | Crash (no assertion): While verifying SIL function "@$s31definite\_init\_variadic\_generics21ThrowingAfterPackInitVACyxxQp\_QPGyKcfC". | \[gist\](https://gist.github.com/alex-reilly-dd/0f11041c38552289c39bb3ea8a62c7d0) |
> | 15 | \`compiler-crash\` | \`test/SILOptimizer/variadic\_generic\_tuple\_assign\_crash.swift\` | Crash (no assertion): While verifying SIL function "@$s35variadic\_generic\_tuple\_assign\_crash9CrashCaseVACyxxQp\_QPGyKcfC". | \[gist\](https://gist.github.com/alex-reilly-dd/95142a5248cebbe54ce9f819493df59d) |
> | 16 | \`enum-pack-rejected\` | \`test/Generics/enum\_pack\_construction.swift\` | unexpected error produced: enums cannot declare a type pack | \[gist\](https://gist.github.com/alex-reilly-dd/7cda368e51a784af0cf1b89a1d4e25d9) |
> | 17 | \`enum-pack-rejected\` | \`test/Generics/enum\_pack\_pattern\_matching.swift\` | unexpected error produced: enums cannot declare a type pack | \[gist\](https://gist.github.com/alex-reilly-dd/36226e0dd7fd1e0c3147851f7284917d) |
> | 18 | \`enum-pack-rejected\` | \`test/Generics/enum\_with\_pack\_basic.swift\` | unexpected error produced: enums cannot declare a type pack | \[gist\](https://gist.github.com/alex-reilly-dd/7f6da72b859581954a1015dbab057e92) |
> | 19 | \`enum-pack-rejected\` | \`test/Interpreter/enum\_parameter\_pack\_cross\_module.swift\` | enums cannot declare a type pack | \[gist\](https://gist.github.com/alex-reilly-dd/b817dee3fcc75bb4eab33cd3e1e78b06) |
> | 20 | \`runtime-dealloc-bug\` | \`test/Concurrency/Runtime/pack\_async\_dealloc\_order.swift\` | freed pointer was not the last allocation | \[gist\](https://gist.github.com/alex-reilly-dd/43894468cdad6e7d403f1fd4409d66b0) |
> | 21 | \`runtime-dealloc-bug\` | \`test/SILGen/pack\_expansion\_multi\_tuple\_concurrent.swift\` | freed pointer was not the last allocation | \[gist\](https://gist.github.com/alex-reilly-dd/62110bad5f196c0cfde68e4dccad7999) |
> | 22 | \`diagnostic-mismatch\` | \`test/Concurrency/sendable\_closure\_pack\_parameter.swift\` | incorrect message found | \[gist\](https://gist.github.com/alex-reilly-dd/79442334ec0694509de9f2704faca263) |
> | 23 | \`diagnostic-mismatch\` | \`test/Constraints/pack\_expansion\_default\_arguments.swift\` | unexpected note produced: in call to function 'singleElementDefault' | \[gist\](https://gist.github.com/alex-reilly-dd/2b5ee1289319b440c3ed3a188f216fb2) |
> | 24 | \`compile-error\` | \`test/Sema/pack\_default\_argument\_inlinable.swift\` | default argument value of type 'DefaultPlugin' cannot be converted to type '(repeat each D)' | \[gist\](https://gist.github.com/alex-reilly-dd/f9ab22d5507c3eaa0084e5cdb657b482) |
> 
> Each gist contains the full lit log captured against the \`main\` toolchain at survey time (assertion message, \`While …\` request context, complete stack frames, and any subsequent test runner output). Stack-frame addresses are from the survey machine.

I'm willing to assist in any way I can if someone more familiar with the compiler architecture is willing to take on these issues.

---

_[View the full topic](https://forums.swift.org/t/lets-talk-about-parameter-packs/83683)._
