[SR-2810] Inconsistent function overload resolution for functions with variadic parameters #45414
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
type checker
Area → compiler: Semantic analysis
Environment
macOS 10.12, Swift 3.0
Additional Detail from JIRA
md5: e88b20b087340e2ceef93c5ec3c2f5bc
Issue Description:
In the following code example, there are two functions with the same base name
f
and the same variadic parameterx
. Both functions are candidates for all four function calls shown below. However, even though the function calls only differ in the number of arguments that are passed to the variadic parameterx
, function overload resolution doesn't always pick the same function:As far as I can tell, the first function is selected when the number of arguments passed to the variadic parameter
x
matches the total number of parameters of the first function. Here's another example:The text was updated successfully, but these errors were encountered: