From 5be50d75fcfbeb941ffeaa8651cd2e544f01b928 Mon Sep 17 00:00:00 2001 From: Joe Shajrawi Date: Mon, 4 Dec 2017 14:31:23 -0800 Subject: [PATCH] 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 --- lib/IRGen/GenEnum.cpp | 2 +- lib/IRGen/GenValueWitness.cpp | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/IRGen/GenEnum.cpp b/lib/IRGen/GenEnum.cpp index 3285596592007..7776b2daeeca7 100644 --- a/lib/IRGen/GenEnum.cpp +++ b/lib/IRGen/GenEnum.cpp @@ -945,7 +945,7 @@ namespace { llvm::MapVector &typeToMetadataVec, SILType T) const override { auto canType = T.getSwiftRValueType(); - assert(!canType->hasArchetype() && + assert(!canType->is() && "collectArchetypeMetadata: no archetype expected here"); } diff --git a/lib/IRGen/GenValueWitness.cpp b/lib/IRGen/GenValueWitness.cpp index 22c1df0bad906..84247a4191d2f 100644 --- a/lib/IRGen/GenValueWitness.cpp +++ b/lib/IRGen/GenValueWitness.cpp @@ -1397,6 +1397,5 @@ void TypeInfo::collectArchetypeMetadata( llvm::MapVector &typeToMetadataVec, SILType T) const { auto canType = T.getSwiftRValueType(); - assert(!canType->getWithoutSpecifierType()->is() && - "Did not expect an ArchetypeType"); + assert(!canType->is() && "Did not expect an ArchetypeType"); }