Skip to content

Commit 466c633

Browse files
committed
[Distributed] Also cover remote distributed call in test
1 parent 2025b44 commit 466c633

File tree

4 files changed

+20
-4
lines changed

4 files changed

+20
-4
lines changed

lib/SIL/IR/SILFunction.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,6 @@ SILType SILFunction::mapTypeIntoContext(SILType type) const {
319319

320320
SILType GenericEnvironment::mapTypeIntoContext(SILModule &M,
321321
SILType type) const {
322-
if (type.hasArchetype())
323-
type.dump();
324322
assert(!type.hasArchetype());
325323

326324
auto genericSig = getGenericSignature().getCanonicalSignature();

lib/SILGen/SILGenDistributed.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -537,8 +537,7 @@ SILGenFunction::emitConditionalResignIdentityCall(SILLocation loc,
537537
"only distributed actors have actorSystem lifecycle hooks in deinit");
538538

539539
auto selfTy = F.mapTypeIntoContext(actorDecl->getDeclaredInterfaceType());
540-
fprintf(stderr, "[%s:%d] (%s) OKEY!!!!!\n", __FILE__, __LINE__, __FUNCTION__);
541-
540+
542541
// we only system.resignID if we are a local actor,
543542
// and thus the address was created by system.assignID.
544543
auto isRemoteBB = createBasicBlock("isRemoteBB");

test/Distributed/Runtime/distributed_actor_func_calls_remoteCall_genericFunc.swift

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ distributed actor Greeter {
3232

3333
}
3434

35+
distributed actor GenericGreeter<Greeting: Sendable & Codable> {
36+
distributed func echo(greeting: Greeting) -> Greeting {
37+
greeting
38+
}
39+
}
40+
3541
func test() async throws {
3642
let system = DefaultDistributedActorSystem()
3743

@@ -62,6 +68,18 @@ func test() async throws {
6268
// CHECK: >> remoteCall: on:main.Greeter, target:main.Greeter.generic2(strict:_:_:), invocation:FakeInvocationEncoder(genericSubs: [Swift.String, Swift.Int], arguments: [2.0, "Caplin", [1, 2, 3]], returnType: Optional(Swift.String), errorType: nil), throwing:Swift.Never, returning:Swift.String
6369
print("reply: \(r2)")
6470
// CHECK: reply: Caplin
71+
72+
let gen = GenericGreeter<String>(actorSystem: system)
73+
let r3 = try await gen.echo(greeting: "Hello generics!")
74+
print("reply: \(r3)")
75+
// CHECK: reply: Hello generics!
76+
77+
let genRef = try GenericGreeter<String>.resolve(id: gen.id, using: system)
78+
let r32 = try await genRef.echo(greeting: "Hello generics!")
79+
// CHECK: > encode generic sub: Swift.String
80+
// CHECK: > encode return type: Swift.String
81+
print("reply: \(r32)")
82+
// CHECK: reply: Hello generics!
6583
}
6684

6785
@main struct Main {

test/Distributed/Runtime/distributed_actor_remote_retains_system.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ public struct FakeResultHandler: DistributedTargetInvocationResultHandler {
130130
fatalError("Not implemented: \(#function)")
131131
}
132132
}
133+
133134
typealias DefaultDistributedActorSystem = FakeActorSystem
134135

135136
// ==== Execute ----------------------------------------------------------------

0 commit comments

Comments
 (0)