Skip to content

Commit 43fbcaa

Browse files
authored
Merge pull request #4468 from benlangmuir/arch-build-crash-3
[codecomplete] Attempt to workaround ArchetypeBuilder crash in non-as…
2 parents 207aef2 + ec82319 commit 43fbcaa

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/AST/ArchetypeBuilder.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1477,6 +1477,10 @@ void ArchetypeBuilder::addRequirement(const Requirement &req,
14771477
case RequirementKind::Conformance: {
14781478
PotentialArchetype *pa = resolveArchetype(req.getFirstType());
14791479
assert(pa && "Re-introducing invalid requirement");
1480+
// FIXME: defensively return if assertions are disabled until we figure out
1481+
// how this sitatuaion can occur and fix it properly.
1482+
if (!pa)
1483+
return;
14801484

14811485
SmallVector<ProtocolDecl *, 4> conformsTo;
14821486
bool existential = req.getSecondType()->isExistentialType(conformsTo);

0 commit comments

Comments
 (0)