mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[CodeCompletion] Only suggest generic params in where for non-protocol
nominal types
This commit is contained in:
@@ -3968,6 +3968,11 @@ public:
|
||||
DeclVisibilityKind::GenericParameter, {});
|
||||
}
|
||||
|
||||
// For non-protocol nominal type decls, only suggest generic parameters.
|
||||
if (auto D = DC->getAsDecl())
|
||||
if (isa<NominalTypeDecl>(D) && !isa<ProtocolDecl>(D))
|
||||
return;
|
||||
|
||||
auto typeContext = DC->getInnermostTypeContext();
|
||||
if (!typeContext)
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user