Skip to content

Commit 18c5322

Browse files
committed
Don't run lifetime dependence inference if GenericEnvironment is not present
1 parent f02448b commit 18c5322

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/AST/LifetimeDependence.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -538,6 +538,10 @@ LifetimeDependenceInfo::infer(AbstractFunctionDecl *afd) {
538538
return std::nullopt;
539539
}
540540

541+
if (afd->getGenericEnvironmentOfContext() == nullptr) {
542+
return std::nullopt;
543+
}
544+
541545
if (getResultOrYield(afd)->hasError()) {
542546
return std::nullopt;
543547
}

0 commit comments

Comments
 (0)