Skip to content

Commit d3f92cb

Browse files
committed
[TBDGen] #if's can appear inside protocols.
1 parent 4f13de3 commit d3f92cb

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/TBDGen/TBDGen.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -395,14 +395,15 @@ void TBDGenVisitor::visitProtocolDecl(ProtocolDecl *PD) {
395395
addSymbol(LinkEntity::forProtocolDescriptor(PD));
396396

397397
#ifndef NDEBUG
398-
// There's no (currently) relevant information about members of a protocol
399-
// at individual protocols, each conforming type has to handle them
400-
// individually. Let's assert this fact:
398+
// There's no (currently) relevant information about members of a protocol at
399+
// individual protocols, each conforming type has to handle them individually
400+
// (NB. anything within an active IfConfigDecls also appears outside). Let's
401+
// assert this fact:
401402
for (auto *member : PD->getMembers()) {
402403
auto isExpectedKind =
403404
isa<TypeAliasDecl>(member) || isa<AssociatedTypeDecl>(member) ||
404405
isa<AbstractStorageDecl>(member) || isa<PatternBindingDecl>(member) ||
405-
isa<AbstractFunctionDecl>(member);
406+
isa<AbstractFunctionDecl>(member) || isa<IfConfigDecl>(member);
406407
assert(isExpectedKind &&
407408
"unexpected member of protocol during TBD generation");
408409
}

0 commit comments

Comments
 (0)