Skip to content

Commit 2e811a4

Browse files
committed
Fixing IDE/crashers/106-swift-moduledecl-lookupconformance.swift
1 parent ef7f8f7 commit 2e811a4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/AST/Module.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,9 @@ TypeBase::gatherAllSubstitutions(Module *module,
592592
unsigned lastGenericIndex = genericParams.size();
593593
while (parent) {
594594
if (auto boundGeneric = parent->getAs<BoundGenericType>()) {
595+
// FIXME: we should check the situation early.
596+
if (lastGenericIndex < boundGeneric->getGenericArgs().size())
597+
return {};
595598
unsigned index = lastGenericIndex - boundGeneric->getGenericArgs().size();
596599
for (Type arg : boundGeneric->getGenericArgs()) {
597600
auto paramTy = genericParams[index++];

0 commit comments

Comments
 (0)