Skip to content

Commit 5be50d7

Browse files
author
Joe Shajrawi
committed
Fixes an invalid assert in No Payload Enum's collectArchetypeMetadata: the type itself might contain an Archetype. We need to check that it is not an Archetype itself
1 parent 9cd54c4 commit 5be50d7

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

lib/IRGen/GenEnum.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -945,7 +945,7 @@ namespace {
945945
llvm::MapVector<CanType, llvm::Value *> &typeToMetadataVec,
946946
SILType T) const override {
947947
auto canType = T.getSwiftRValueType();
948-
assert(!canType->hasArchetype() &&
948+
assert(!canType->is<ArchetypeType>() &&
949949
"collectArchetypeMetadata: no archetype expected here");
950950
}
951951

lib/IRGen/GenValueWitness.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1397,6 +1397,5 @@ void TypeInfo::collectArchetypeMetadata(
13971397
llvm::MapVector<CanType, llvm::Value *> &typeToMetadataVec,
13981398
SILType T) const {
13991399
auto canType = T.getSwiftRValueType();
1400-
assert(!canType->getWithoutSpecifierType()->is<ArchetypeType>() &&
1401-
"Did not expect an ArchetypeType");
1400+
assert(!canType->is<ArchetypeType>() && "Did not expect an ArchetypeType");
14021401
}

0 commit comments

Comments
 (0)