Open
Description
Description
When defining a closure that leverages parameter packs, the compiler can't infer the parameter type from the values in the closure.
Reproduction
Below is a code snippet from the attached example project.
@resultBuilder
enum ShowcaseContentBuilder {
public static func buildBlock<each Content: View, ColumnType: ShowcaseColumnRepresentable>(_ content: repeat ShowcaseRow<ColumnType, each Content>) -> (repeat ShowcaseRow<ColumnType, each Content>) {
(repeat each content)
}
}
Showcase(title: "Showcase", columns: IconTestAsset.allCases) {
ShowcaseRow(name: "Test 1") { icon in
Image(systemName: icon.rawValue)
}
ShowcaseRow(name: "Test 2") { icon in
Image(systemName: icon.rawValue)
}
}
Expected behavior
The above code should be able to to infer icon
is of type IconTestAsset
, but the code fails to compile with the following errors:
- Generic parameter 'each EntryContent' could not be inferred
- Cannot infer type of closure parameter 'icon' without a type annotation

Environment
swift-driver version: 1.115.1 Apple Swift version 6.0.3 (swiftlang-6.0.3.1.10 clang-1600.0.30.1)
Target: arm64-apple-macosx15.0
Additional information
I joined a 1on1 lab with folks from the Swift team during WWDC and they suggested this is a dupe of #78426, but they encouraged me to file a new issue and share my example code