[SR-494] Cannot call function with variadic arguments before a required unnamed parameter #43111
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler itself
type checker
Area → compiler: Semantic analysis
Environment
Apple Swift version 2.1.1 (swiftlang-700.1.101.15 clang-700.1.81)
Apple Swift version 2.2-dev (LLVM 3ebdbb2c7e, Clang f66c5bb67b, Swift 54dcd16)
Additional Detail from JIRA
md5: 9c3271fc49314ea7082f4bfb393d4cff
relates to:
Issue Description:
When declaring a function that takes variadic arguments followed by a required parameter, such as
this is accepted, but there's no way to call the function. Any attempt to do so fails with an error, e.g.
fails with the error
I consider this a bug, because this call is unambiguous. There is a single required parameter after the variadic arguments, which means that the last parameter in the call must correspond with this unnamed parameter.
More generally, Swift should be able to figure out how to invoke functions that have one or more unnamed parameters after the variadic parameter list as long as the unnamed parameters do not have default values.
The text was updated successfully, but these errors were encountered: