Skip to content

Commit e12d53e

Browse files
authored
Merge pull request #67117 from ktoso/wip-distributed-generic-fail
2 parents d2c8ede + 64e4136 commit e12d53e

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

lib/IRGen/GenDistributed.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,8 @@ void DistributedAccessor::emit() {
616616

617617
auto params = IGF.collectParameters();
618618

619+
GenericContextScope scope(IGM, targetTy->getInvocationGenericSignature());
620+
619621
auto directResultTy = targetConv.getSILResultType(expansionContext);
620622
const auto &directResultTI = IGM.getTypeInfo(directResultTy);
621623

@@ -652,8 +654,6 @@ void DistributedAccessor::emit() {
652654
// Witness table for decoder conformance to DistributedTargetInvocationDecoder
653655
auto *decoderProtocolWitness = params.claimNext();
654656

655-
GenericContextScope scope(IGM, targetTy->getInvocationGenericSignature());
656-
657657
// Preliminary: Setup async context for this accessor.
658658
{
659659
auto fpKind = FunctionPointerKind::defaultAsync();

test/IRGen/distributed_actor.swift

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,25 @@ public distributed actor MyActor {
1212
public typealias ActorSystem = LocalTestingDistributedActorSystem
1313
// nothing
1414
}
15+
16+
/// This combination of DistributedActor + Codable used to trigger a crash in DistributedAccessor::emit (rdar://111664985)
17+
/// So returning it from distributed methods in the types below covers this radar.
18+
public protocol ClusterSingleton: DistributedActor, Codable {}
19+
20+
@available(SwiftStdlib 5.6, *)
21+
public distributed actor MyActorGenerics {
22+
public typealias ActorSystem = LocalTestingDistributedActorSystem
23+
24+
distributed func find<Act: ClusterSingleton>(byName name: String) -> Act {
25+
fatalError("mock impl")
26+
}
27+
}
28+
29+
@available(SwiftStdlib 5.6, *)
30+
public distributed actor MyActorGenericsOnType<Act: ClusterSingleton> {
31+
public typealias ActorSystem = LocalTestingDistributedActorSystem
32+
33+
distributed func find(byName name: String) -> Act {
34+
fatalError("mock impl")
35+
}
36+
}

0 commit comments

Comments
 (0)