@@ -473,10 +473,11 @@ void TBDGenVisitor::addConformances(DeclContext *DC) {
473
473
rootConformance);
474
474
auto addSymbolIfNecessary = [&](ValueDecl *requirementDecl,
475
475
ValueDecl *witnessDecl) {
476
- auto witnessLinkage = SILDeclRef (witnessDecl).getLinkage (ForDefinition);
476
+ auto witnessRef = SILDeclRef (witnessDecl);
477
+ auto witnessLinkage = witnessRef.getLinkage (ForDefinition);
477
478
if (conformanceIsFixed &&
478
479
(isa<SelfProtocolConformance>(rootConformance) ||
479
- fixmeWitnessHasLinkageThatNeedsToBePublic (witnessLinkage ))) {
480
+ fixmeWitnessHasLinkageThatNeedsToBePublic (witnessRef ))) {
480
481
Mangle::ASTMangler Mangler;
481
482
addSymbol (
482
483
Mangler.mangleWitnessThunk (rootConformance, requirementDecl));
@@ -496,7 +497,8 @@ void TBDGenVisitor::addConformances(DeclContext *DC) {
496
497
addSymbolIfNecessary (reqtAccessor, witnessAccessor);
497
498
});
498
499
} else if (isa<EnumElementDecl>(witnessDecl)) {
499
- addSymbolIfNecessary (valueReq, witnessDecl);
500
+ auto getter = storage->getSynthesizedAccessor (AccessorKind::Get);
501
+ addSymbolIfNecessary (getter, witnessDecl);
500
502
}
501
503
}
502
504
});
@@ -1016,13 +1018,12 @@ void TBDGenVisitor::visitProtocolDecl(ProtocolDecl *PD) {
1016
1018
1017
1019
void TBDGenVisitor::visitEnumDecl (EnumDecl *ED) {
1018
1020
visitNominalTypeDecl (ED);
1019
-
1020
- if (!ED->isResilient ())
1021
- return ;
1022
1021
}
1023
1022
1024
1023
void TBDGenVisitor::visitEnumElementDecl (EnumElementDecl *EED) {
1025
- addSymbol (LinkEntity::forEnumCase (EED));
1024
+ if (EED->getParentEnum ()->isResilient ())
1025
+ addSymbol (LinkEntity::forEnumCase (EED));
1026
+
1026
1027
if (auto *PL = EED->getParameterList ())
1027
1028
visitDefaultArguments (EED, PL);
1028
1029
}
0 commit comments