mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Allow extractConstantsFromMembers on all nominal decls
This commit is contained in:
@@ -58,11 +58,17 @@ public:
|
||||
if (auto *ETD = dyn_cast<ExtensionDecl>(D))
|
||||
NTD = ETD->getExtendedNominal();
|
||||
if (NTD)
|
||||
if (!isa<ProtocolDecl>(NTD) && CheckedDecls.insert(NTD).second)
|
||||
if (!isa<ProtocolDecl>(NTD) && CheckedDecls.insert(NTD).second) {
|
||||
if (NTD->getAttrs().hasAttribute<ExtractConstantsFromMembersAttr>()) {
|
||||
ConformanceTypeDecls.push_back(NTD);
|
||||
return Action::Continue();
|
||||
}
|
||||
|
||||
for (auto &Protocol : NTD->getAllProtocols())
|
||||
if (Protocol->getAttrs().hasAttribute<ExtractConstantsFromMembersAttr>() ||
|
||||
Protocols.count(Protocol->getName().str().str()) != 0)
|
||||
ConformanceTypeDecls.push_back(NTD);
|
||||
}
|
||||
return Action::Continue();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user