mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
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:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user