Commits

Joe Pamer committed 0896a12197a
Further improve type checker diagnostics through a variety of means. Start capitalizing on some of the new diagnostic machinery in a few different ways: - When mining constraints for type information, utilize constraints "favored" by the overload resolution process. - When printing type variables, if the variable was created by opening a literal expression, utilize the literal default type or conformance if possible. - Utilize syntactic information when crafting diagnostics: - If the constraint miner can produce a better diagnostic than the recorded failure, diagnose via constraints. - Factor in the expression kind when choosing which types to include in a diagnostic message. - Start customizing diagnostics based on the amount of type data available. What does all this mean? - Fewer type variables leaking into diagnostic messages. - Far better diagnostics for overload resolution failures. Specifically, we now print proper argument type data for failed function calls. - No more "'Foo' is not convertible to 'Foo'" error messages - A greater emphasis on type data means less dependence on the ordering of failed constraints. This means fewer inscrutable diagnostics complaining about 'UInt8' when all the constituent expressions are of type Float. So we still have a ways to go, but these changes should greatly improve the number of head-scratchers served up by the type checker. These changes address the following radars: rdar://problem/17618403 rdar://problem/17559042 rdar://problem/17007456 rdar://problem/17559042 rdar://problem/17590992 rdar://problem/17646988 rdar://problem/16979859 rdar://problem/16922560 rdar://problem/17144902 rdar://problem/16616948 rdar://problem/16756363 rdar://problem/16338509 Swift SVN r20927