Skip to content

Commit de332d0

Browse files
committed
AST: Don't kick off getGenericSignature() from computeCanonicalType()
1 parent 27f8f72 commit de332d0

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lib/AST/Type.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1468,10 +1468,9 @@ CanType TypeBase::computeCanonicalType() {
14681468
// If we haven't set a depth for this generic parameter, try to do so.
14691469
// FIXME: This is a dreadful hack.
14701470
if (gpDecl->getDepth() == GenericTypeParamDecl::InvalidDepth) {
1471-
if (auto decl =
1472-
gpDecl->getDeclContext()->getInnermostDeclarationDeclContext())
1473-
if (auto valueDecl = decl->getAsGenericContext())
1474-
(void)valueDecl->getGenericSignature();
1471+
auto *dc = gpDecl->getDeclContext();
1472+
auto *gpList = dc->getAsDecl()->getAsGenericContext()->getGenericParams();
1473+
gpList->setDepth(dc->getGenericContextDepth());
14751474
}
14761475

14771476
assert(gpDecl->getDepth() != GenericTypeParamDecl::InvalidDepth &&

0 commit comments

Comments
 (0)