Commits

Chris Lattner committed e41c23801f4
A bunch of conflated changes: - Fix TypeCheckExpr.cpp to be more careful when propagating sugar from an argument to the result of the function. We don't want to propagate parens, because they show up in diagnostics later. - Restructure FailureDiagnosis::diagnoseFailure() to strictly process the tree in depth first order. Before it would only do this if contextual typing was unavailable, leading to unpredictable inconsistencies between diagnostics. - Always perform diagnoseContextualConversionError early, as part of the thing that calls the visitor, instead of in each visit method. This may change in the future, but is a simplification for now. - Make the operator processing code handle the "candidate is an exact match" case by emitting a diagnostic indicating that the result type of the operator must not match expectations, instead of emitting the silly things like "binary operator '&' cannot be applied to two Int operands" which is obviously false. These changes lead to minor improvements across the testsuite, and should make the diagnostics more predictable for more complex real-world ones, but I haven't gone through the radars yet. Major missing pieces: - CallExpr isn't using the same logic that the operators are. - When you have a near match (only one argument mismatches) we should specifically complain about that argument, instead of spewing an entire argument list. - The noescape function attr diagnostic is being emitted twice now. Swift SVN r29733