mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Diagnostics] Unsatisfied requirement in reference diagnostics expect type context
Resolves: rdar://problem/50666427
This commit is contained in:
@@ -336,8 +336,9 @@ bool RequirementFailure::diagnoseAsError() {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (genericCtx != reqDC && (genericCtx->isChildContextOf(reqDC) ||
|
||||
isStaticOrInstanceMember(AffectedDecl))) {
|
||||
if (reqDC->isTypeContext() && genericCtx != reqDC &&
|
||||
(genericCtx->isChildContextOf(reqDC) ||
|
||||
isStaticOrInstanceMember(AffectedDecl))) {
|
||||
auto *NTD = reqDC->getSelfNominalTypeDecl();
|
||||
emitDiagnostic(anchor->getLoc(), getDiagnosticInRereference(),
|
||||
AffectedDecl->getDescriptiveKind(),
|
||||
|
||||
Reference in New Issue
Block a user