Open
Description
Description
When passing a value pack to a function that accepts a variadic parameter, this diagnostic is emitted: cannot pass value pack expansion to non-pack parameter of type 'Any'
Steps to reproduce
Consider the following code:
func variadic<each T>(element: repeat each T) {
print(repeat each element)
}
Expected behavior
The above code should be valid as the value parameter pack should expand into the variadic parameter Any...
for the print
function.
Environment
- Swift version 5.9 (swiftlang-5.9.0.128.108 clang-1500.0.40.1)
Metadata
Metadata
Assignees
Labels
A deviation from expected or documented behavior. Also: expected but undesirable behavior.Feature → expressions: Call expressionsThe Swift compiler itselfFeature: expressionsFeature → declarations: function parametersFeature: generic declarations and typesFeature → generics: Parameter packsArea → compiler: Semantic analysisBug: Unexpected errorFeature → declarations → function parameters: Variadic function parameters