[Diagnostics] Use ContextualFailure and ContextualMistatch as base classes

for `AutoClosurePointerConversionFailure` and `AllowAutoClosurePointerConversion`
respectively.
This commit is contained in:
Holly Borla
2019-08-02 15:23:25 -07:00
parent e76f5f1d0b
commit edcf4055d2
4 changed files with 7 additions and 14 deletions

View File

@@ -1981,7 +1981,7 @@ bool AutoClosureForwardingFailure::diagnoseAsError() {
bool AutoClosurePointerConversionFailure::diagnoseAsError() {
auto *anchor = getAnchor();
auto diagnostic = diag::invalid_autoclosure_pointer_conversion;
emitDiagnostic(anchor->getLoc(), diagnostic, PointeeType, PointerType)
emitDiagnostic(anchor->getLoc(), diagnostic, getFromType(), getToType())
.highlight(anchor->getSourceRange());
return true;
}