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-5198] Diagnostics are pretty much always useless when errors involve type inference and closures #47774
Comments
cc @xedin |
Another example showing how Swift fails to produce diagnostics in the most simple cases: SR-5233 |
And another one: https://bugs.swift.org/browse/SR-5245 |
FYI I've been updating the list of diagnostic issues here. It's grown to 14 including this one... I hope you guys can get to them soon cause the state of this in Swift 4.0 is currently pretty embarrassing. |
@swift-ci create |
Any update on these? I just filed SR-6285, as I keep running into more and more useless diagnostics. Honestly, nobody cares about ABI stability if we can't actually write code. |
And another one: SR-6292. |
Is there going to be any focus on diagnostics for any future version of Swift or should I just give up filing these? |
@NachoSoto Please keep filling the bugs! The problem is that, as I mentioned, the framework has to change completely before we can properly diagnose certain cases, I'm working on it, that just takes time to do. |
Is this going to be a priority for Swift 5.0? |
Added another one: SR-6876. Is this going to be a priority for Swift 5.0? I'm up to 17 unresolved diagnostic Jiras... |
@NachoSoto Thanks! Diagnostics are always a priority, but fixing them usually requires significant time, that's why everything is going slowly. |
Another one: SR-6994. |
I have removed `, _` from `isRepeat` and tried with 5.2 snapshot and got following diagnostic:
This is exactly what you are taking about so I'd really appreciate if you have verified using 5.2 nightly and closed. I'll take a look at the rest of the list meanwhile. |
Environment
Swift version 4.0 (swiftlang-900.0.43 clang-900.0.22.8)
Swift version 4.0 (swiftlang-900.0.63.10 clang-900.0.36)
Swift version 4.0.2 (swiftlang-900.0.69.1 clang-900.0.38)
Swift version 4.0.3 (swiftlang-900.0.74.1 clang-900.0.39.2)
Swift version 4.1 (swiftlang-902.0.34 clang-902.0.30)
Additional Detail from JIRA
md5: 6266990ac5135a6213094a3641402482
Issue Description:
I'm filing a particular example, but this is just one of the hundreds I've ran into regarding this since Swift 1.0. I honestly don't think this has gotten any better since the very first version.
This is a reduction from my own codebase. As I was going through the Swift 4.0 migrations, lots of places relying on tuple deconstruction in closure parameters stopped working, and diagnostics leave A LOT to be desired (https://twitter.com/NachoSoto/status/874336197568454656, https://twitter.com/NachoSoto/status/874336844757975040).
Consider this:
This was compiling in Swift 3.x. Notice the `isRepeat` parameter I'm passing only has one _.
Say what? What's the problem in d? That looks correct to me...
Spoiler alert, the correct fix is changing isRepeat to
Instead of just _.
Again, like I said in the title, this is not an isolated bug, this happens ALL THE TIME when types can't be inferred. Diagnostic always point to the wrong thing with a useless message.
When are you going to start focusing on diagnostics? I have filed SO MANY diagnostic bugs that are still open:
SR-4795
SR-4664SR-4587
SR-4536
SR-4318
SR-4270
SR-5199SR-5203
SR-5233
SR-5243
SR-5245
SR-5261SR-5273SR-5388
SR-5715
SR-5747
SR-6285
SR-6292
SR-6730
SR-6801
SR-6876
SR-6994
The text was updated successfully, but these errors were encountered: