Skip to content

Commit c3f7288

Browse files
committed
Sema: Initialize capture info for functions without bodies
1 parent 4af5140 commit c3f7288

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/Sema/TypeCheckCaptures.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -623,8 +623,10 @@ void TypeChecker::computeCaptures(AnyFunctionRef AFR) {
623623
if (AFR.getCaptureInfo().hasBeenComputed())
624624
return;
625625

626-
if (!AFR.getBody())
626+
if (!AFR.getBody()) {
627+
AFR.setCaptureInfo(CaptureInfo::empty());
627628
return;
629+
}
628630

629631
PrettyStackTraceAnyFunctionRef trace("computing captures for", AFR);
630632

0 commit comments

Comments
 (0)