There is a new blog post on Swift.org titled "New Diagnostic Architecture Overview" that talks about investments in Swift 5.1and the upcoming Swift 5.2 release to improve the diagnostics from the compiler:
The post is written by @xedin. Please feel free to ask questions about the blog post here!
Yes! I'm preparing changes to documentation which are going to talk about ConstraintFix and FailureDiagnostic interfaces and give examples of how to create a new fix/diagnostic and integrate it into the solver.
My understanding of Lantua’s suggestion is that, if we have some time limit on type checking that produces an error if an expression goes beyond x seconds, then we could raise a warning for expressions which do type check successfully, but take more than, say, x/2 seconds.
There are existing flags for that already as @suyashsrijan points out, but using timers/memory is unreliable and we couldn't find a better algorithmic criteria to estimate how complex the expression is going to be (for now).
This was a fascinating read - and a reminder that I am not nearly smart enough to write a compiler.
I stumbled into this after spending over 2 hours chasing phantom errors (like "Double cannot be converted to CGFloat") when the real problem was that I missed a $ when passing a binding in a SwiftUI view somewhere else. Very much looking forward to the 5.2 release!