Skip to content

Commit bf9b4e3

Browse files
authored
Merge pull request #59819 from jckarter/missing-sendable-conformance-in-subst-function-type
SIL: Allow missing Sendable conformances when building abstraction pattern for function type lowering.
2 parents c70f493 + 8a4743a commit bf9b4e3

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

lib/SIL/IR/AbstractionPattern.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1878,7 +1878,8 @@ const {
18781878
if (conformingReplacementType->isTypeParameter())
18791879
return ProtocolConformanceRef(conformedProtocol);
18801880

1881-
return TC.M.lookupConformance(conformingReplacementType, conformedProtocol);
1881+
return TC.M.lookupConformance(conformingReplacementType, conformedProtocol,
1882+
/*allowMissing*/ true);
18821883
});
18831884

18841885
auto yieldType = visitor.substYieldType;
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// RUN: %target-swift-emit-silgen -warn-concurrency %s
2+
3+
protocol ServerStream {}
4+
protocol Message {}
5+
6+
struct RPCServerHandlerContext {}
7+
struct RPCRequestStream<Request: Sendable> {}
8+
struct RPCResponseStream<Response: Sendable> {}
9+
10+
final class RPCServerHandler<Stream: ServerStream, Request: Message, Response: Message> {
11+
/// The actual user function. We are using a bi-directional function shape here and will map the other shapes into this one.
12+
private let userFunction: (
13+
RPCServerHandlerContext,
14+
RPCRequestStream<Request>,
15+
RPCResponseStream<Response>
16+
) async throws -> Void
17+
18+
init(
19+
userFunction: @escaping @Sendable (
20+
RPCServerHandlerContext,
21+
RPCRequestStream<Request>,
22+
RPCResponseStream<Response>
23+
) async throws -> Void
24+
) {
25+
self.userFunction = userFunction
26+
}
27+
}

0 commit comments

Comments
 (0)