Merge pull request #19447 from xedin/fix-req-diagnstics-not-to-print-special-names

[CSDiagnostics] Don't mention special names in requirement diagnostics
This commit is contained in:
Pavel Yaskevich
2018-09-21 14:17:08 -07:00
committed by GitHub
9 changed files with 34 additions and 32 deletions

View File

@@ -141,16 +141,16 @@ bool RequirementFailure::diagnoseAsError() {
const auto *reqDC = getRequirementDC();
auto *genericCtx = AffectedDecl->getAsGenericContext();
auto declName = AffectedDecl->getFullName();
if (reqDC != genericCtx) {
auto *NTD = reqDC->getSelfNominalTypeDecl();
emitDiagnostic(anchor->getLoc(), getDiagnosticInRereference(),
AffectedDecl->getDescriptiveKind(),
AffectedDecl->getFullName(), NTD->getDeclaredType(),
getLHS(), getRHS());
AffectedDecl->getDescriptiveKind(), declName.isSpecial(),
declName, NTD->getDeclaredType(), getLHS(), getRHS());
} else {
emitDiagnostic(anchor->getLoc(), getDiagnosticOnDecl(),
AffectedDecl->getDescriptiveKind(),
AffectedDecl->getFullName(), getLHS(), getRHS());
AffectedDecl->getDescriptiveKind(), declName.isSpecial(),
declName, getLHS(), getRHS());
}
emitRequirementNote(reqDC->getAsDecl());