mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Introduce some infrastructure that allows us to speculatively apply localized fixes to expressions during constraint solving to fix minor typos and omissions. At present, we're able to introduce the fixes during constraint simplification, prefer systems with fewer fixes when there are multiple fixes, and diagnose the fixes with Fix-Its. Actually rewriting the AST to reflect what the Fix-Its are doing is still not handled. As a start, introduce a fix that adds '()' if it appears to have been forgotton, producing a diagnostic like this if it works out: t.swift:8:3: error: function produces expected type 'B'; did you mean to call it with '()'? f(g) ^ () Note that we did regress in one test case (test/NameBinding/multi-file.swift), because that diagnostic was getting lucky with the previous formulation. Swift SVN r16937
82 KiB
82 KiB