New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SR-2450] Wrong min() function is selected for call #45055
Comments
This was fixed a while ago. |
I still see an error for this in Xcode 9.0 running Swift 4.0, has it been fixed since then? |
Sorry I was too quick in closing this out without any explanation. The local The proposed change in behavior here would have to go through |
Leaving it open and under the tag |
This is essentially the same issue as this: https://bugs.swift.org/browse/SR-7018 And here's another one: |
@jepers, yes you are right. However, @slavapestov has pointed out on the Swift forums that since SE–0111 makes argument labels part of function names, we ought to update the lookup rules so that only functions whose names including argument labels match the call-site are considered. That is not quite as straightforward as it sounds, because we have to account for “missing” argument labels due to default values and trailing closures, as well as “extra” arguments with variadic parameters. Nonetheless, it is still eminently achievable, and appears necessary as part of SE–0111. Even if the current behavior might technically have been “working as intended” prior to SE–0111, nowadays it ought to be considered a bug. |
OK, thanks! |
Environment
Xcode Version 8.0 beta 6 (8S201h)
Additional Detail from JIRA
md5: 29ef06ccf0e63a3fe41d3cead2c2f4cf
Issue Description:
see snippet below
there is no local function min(x:y:) therefore I think compiler should automatically choose right Swift.min(x:y:) function, rather than trying to use local min() [no arguments].
The text was updated successfully, but these errors were encountered: