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-7059] Failed to infer generic type parameter in Xcode 9.3 beta 3 #49607
Comments
Looks like this has been broken for a while now, I've tried with snapshot from 1/30 (the earliest I have) and it fails there too... Going to try to get some more nightlies and see when it started. |
Here is the minimized test-case:
I'm not exactly sure what is going on yet but it's related to - 3b7e555 |
Ok think is actually interesting because `foo` returns `U` and `baz` returns `Self` but `error:` branch returns Void which means that we are trying to infer `U` to be `Self.V` and `Void` which are not convertible. It looks like in 4.1 (this has failing on 4.0) we ended up inferring `U` to be `Void` somehow, trying to figure out how that happened. |
@sharplet as a work around for now you can add return () after `analysis` call. |
@rudkx Looks like constraint edge contraction changes exposed a problem in the `getPontentialBindings` once again, because for this particular expression it changes order in which we attempt them. |
Previously `Void` be inferred because we tried result type of the outermost closure first and `U` is convertible to that type. |
Thanks so much! I've subsequently found the instructions on running nightlies, and I do see this fixed in master (but not 4.1?). I appreciate the fix, and I also appreciate the papertrail between this issue and the PR that fixed it. |
Happy to help! Sorry but you'll have to use workaround for now since this was too late in the cycle to make it to 4.1 |
@sharplet, Could you verify if the problem is fixed and if so move the JIRA to "Closed"? |
The same commit (6.0.0, 8659746df02d8f62a112eda288f4f2f3bab368f) appears to fail in a different way on Xcode 9.4: ▸ Compiling Result+BrightFutures.swift
⚠️ /Users/adsharp/src/Thomvis/BrightFutures/Sources/BrightFutures/Result+BrightFutures.swift:51:21: result of call is unused, but produces '_'
complete(res.analysis(ifSuccess: {
^
❌ /Users/adsharp/src/Thomvis/BrightFutures/Sources/BrightFutures/Result+BrightFutures.swift:48:16: generic parameter 'T' could not be inferred
return Future { complete in
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~ |
@sharplet It seems like the fix didn't make it to 9.4 but I've tried to build the BrightFutures project with 10 beta 4 and it compiled just fine, could you please try that out as well? |
Yes, it compiled fine in beta 4 for me! |
Environment
Xcode Version 9.3 beta 3 (9Q117m)
macOS High Sierra Version 10.13.3 (17D47)
Additional Detail from JIRA
md5: 604d9e44d4f998c77ba621c74606f260
Issue Description:
To reproduce:
Error message:
The text was updated successfully, but these errors were encountered: