-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Open
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.call expressionsFeature → expressions: Call expressionsFeature → expressions: Call expressionscompilerThe Swift compiler itselfThe Swift compiler itselfexpressionsFeature: expressionsFeature: expressionsfunction parametersFeature → declarations: function parametersFeature → declarations: function parametersgenericsFeature: generic declarations and typesFeature: generic declarations and typesparameter packsFeature → generics: Parameter packsFeature → generics: Parameter packsswift 5.9type checkerArea → compiler: Semantic analysisArea → compiler: Semantic analysisunexpected errorBug: Unexpected errorBug: Unexpected errorvariadic parametersFeature → declarations → function parameters: Variadic function parametersFeature → declarations → function parameters: Variadic function parameters
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)
peterkos, davedelong and vakhidbetrakhmadov
Metadata
Metadata
Assignees
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.call expressionsFeature → expressions: Call expressionsFeature → expressions: Call expressionscompilerThe Swift compiler itselfThe Swift compiler itselfexpressionsFeature: expressionsFeature: expressionsfunction parametersFeature → declarations: function parametersFeature → declarations: function parametersgenericsFeature: generic declarations and typesFeature: generic declarations and typesparameter packsFeature → generics: Parameter packsFeature → generics: Parameter packsswift 5.9type checkerArea → compiler: Semantic analysisArea → compiler: Semantic analysisunexpected errorBug: Unexpected errorBug: Unexpected errorvariadic parametersFeature → declarations → function parameters: Variadic function parametersFeature → declarations → function parameters: Variadic function parameters