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-6939] Swift 4.1 type-checker regression: cannot convert value of type 'Double' to expected argument type '_?' #49487
Comments
@swift-ci create |
@rudkx, another autoclosure one. :-( |
BTW ([1.0] as [Double]).sum like you suggested @belkadan does compile, so I'm changing it to that (which is probably cleaner anyway), but this regression can likely surface in other contexts? |
I think might be because |
Pavel, can you see if this is covered by #14441 |
@rudkx it doesn't look like the problem here is related to function attributes because second `expect` can't match since it requires a label `expression` to properly form that call. So much changes didn't fix this one. |
Getting rid of the autoclosures produces the same problem.
|
Interesting. This might be because the expression is ambiguous now (I got some combination of this code to also produce the same error in Swift 4.0.x). This needs a better diagnostic too, whatever the problem actually is. |
It looks like the problem here is actually related to initializer of the Double and how we attempt the bindings, probably we loose implicit conversion to optional on the way which results in no solutions produces for this expression and bad diagnostics... |
Pavel fixed this and cherry-picked the fix to the 4.1 branch in #14490 |
Environment
Swift version 4.1 (swiftlang-902.0.38 clang-902.0.30)
Target: x86_64-apple-darwin17.4.0
Additional Detail from JIRA
md5: f7d715104f73ab7429cf6e14e955bb49
Issue Description:
This is a reduction from my project (thanks to @belkadan for helping me reduce it).
The following code compiles on Swift 4.0.3:
But fails to compile on Swift 4.1 (as of Xcode 9.3 beta 2):
The text was updated successfully, but these errors were encountered: