Skip to content

Commit 1dd24a6

Browse files
committed
[SILGen] Make sure we emit lazy conformances for @asyncHandlers.
Fixes rdar://73798572.
1 parent 748339a commit 1dd24a6

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

lib/SILGen/SILGenFunction.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,8 @@ void SILGenFunction::emitAsyncHandler(FuncDecl *fd) {
559559
bodyFn->setDebugScope(new (getModule()) SILDebugScope(loc, bodyFn));
560560

561561
SILGenFunction(SGM, *bodyFn, fd).emitFunction(fd);
562-
562+
SGM.emitLazyConformancesForFunction(bodyFn);
563+
563564
// 2. step: emit the original asyncHandler function
564565
//
565566
Scope scope(*this, loc);
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// RUN: %target-swift-emit-silgen -sdk %S/Inputs -I %S/Inputs -enable-source-import %s -enable-experimental-concurrency > %t.out
2+
// RUN: %FileCheck -check-prefix=CHECK -check-prefix=CHECK-%target-ptrsize %s < %t.out
3+
// RUN: %FileCheck -check-prefix=NEGATIVE %s < %t.out
4+
5+
// REQUIRES: objc_interop
6+
// REQUIRES: concurrency
7+
8+
import gizmo
9+
10+
func hashEm<H: Hashable>(_ x: H) {}
11+
12+
public class A {
13+
@asyncHandler
14+
public func f() {
15+
hashEm(NSRuncingOptions.mince)
16+
}
17+
}
18+
19+
// CHECK: sil_witness_table shared [serialized] NSRuncingOptions: Hashable module gizmo

0 commit comments

Comments
 (0)