Commits

Doug Gregor committed 42bb2528dda
[Overload resolution] Prefer functions with fewer defaulted/variadic arguments. When comparing two functions for overload resolution, break apart the parameter lists to compare individual parameters rather than comparing the tuples. This allows us to prefer functions with fewer arguments to ones with more, defaulted or variadic arguments. That preference was already encoded in the constraint optimizer, which led to some strange behavior where the preference was expressed for function calls but not for calls to initializers. Fixes rdar://problem/24128153. The standard library change tweaks the anachronistic, unavailable "print" variants somewhat. The only behavior change here is a slight regression for cases like: print(a: 1, b: 2) where we used to produce a diagnostic: Please wrap your tuple argument in parentheses: 'print((...))' but we now get: argument labels '(a:, b:)' do not match any available overloads However, this regression will happen at some point *anyway*, if SE-0029 (or anything else that removes the implicit tuple splat operation) goes through.