We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ef7f8f7 commit 2e811a4Copy full SHA for 2e811a4
lib/AST/Module.cpp
@@ -592,6 +592,9 @@ TypeBase::gatherAllSubstitutions(Module *module,
592
unsigned lastGenericIndex = genericParams.size();
593
while (parent) {
594
if (auto boundGeneric = parent->getAs<BoundGenericType>()) {
595
+ // FIXME: we should check the situation early.
596
+ if (lastGenericIndex < boundGeneric->getGenericArgs().size())
597
+ return {};
598
unsigned index = lastGenericIndex - boundGeneric->getGenericArgs().size();
599
for (Type arg : boundGeneric->getGenericArgs()) {
600
auto paramTy = genericParams[index++];
0 commit comments