Skip to content

Commit 276110b

Browse files
authored
Merge pull request #40049 from ktoso/wip-transport-no-default
2 parents 293e97a + 61a1bc2 commit 276110b

23 files changed

+63
-23
lines changed

lib/SILGen/SILGenDistributed.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,6 @@ static SILValue emitActorPropertyReference(
5151
VarDecl *property) {
5252
Type formalType = SGF.F.mapTypeIntoContext(property->getInterfaceType());
5353
SILType loweredType = SGF.getLoweredType(formalType).getAddressType();
54-
#if false
55-
if (!loweredType.isAddress()) {
56-
loweredType = SILType::getPrimitiveAddressType(
57-
formalType->getCanonicalType());
58-
}
59-
#endif
6054
return SGF.B.createRefElementAddr(loc, actorSelf, property, loweredType);
6155
}
6256

stdlib/public/Distributed/ActorTransport.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,6 @@ public struct AnyActorTransport: ActorTransport {
108108
}
109109
}
110110

111-
/// Use the existential wrapper as the default actor transport.
112-
@available(SwiftStdlib 5.6, *)
113-
public typealias DefaultActorTransport = AnyActorTransport
111+
///// Use the existential wrapper as the default actor transport.
112+
//@available(SwiftStdlib 5.6, *)
113+
//public typealias DefaultActorTransport = AnyActorTransport

stdlib/public/Distributed/DistributedActor.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public protocol AnyActor: Sendable, AnyObject {}
3535
/// distributed actor.
3636
@available(SwiftStdlib 5.6, *)
3737
public protocol DistributedActor:
38-
AnyActor, Sendable, Identifiable, Hashable, Codable {
38+
AnyActor, Identifiable, Hashable, Codable {
3939
/// The type of transport used to communicate with actors of this type.
4040
associatedtype Transport: ActorTransport
4141

test/Distributed/Inputs/dynamic_replacement_da_decl.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
import _Distributed
1616

1717
distributed actor DA {
18+
typealias Transport = AnyActorTransport
19+
1820
distributed func hello(other: DA) {}
1921
}
2022

test/Distributed/SIL/distributed_actor_default_deinit_sil.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
import _Distributed
66

7+
/// Use the existential wrapper as the default actor transport.
8+
typealias DefaultActorTransport = AnyActorTransport
9+
710
class SomeClass {}
811

912
distributed actor MyDistActor {

test/Distributed/SIL/distributed_actor_default_init_sil.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
import _Distributed
66

7+
/// Use the existential wrapper as the default actor transport.
8+
typealias DefaultActorTransport = AnyActorTransport
9+
710
class SomeClass {}
811

912
distributed actor MyDistActor {

test/Distributed/actor_protocols.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ struct E: Actor {
3232

3333
// ==== -----------------------------------------------------------------------
3434

35-
distributed actor DA: DistributedActor {} // ok
35+
distributed actor DA: DistributedActor {
36+
typealias Transport = AnyActorTransport
37+
}
3638

3739
actor A2: DistributedActor {
3840
// expected-error@-1{{non-distributed actor type 'A2' cannot conform to the 'DistributedActor' protocol}} {{1-1=distributed }}

test/Distributed/distributed_actor_basic.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
import _Distributed
66

7+
/// Use the existential wrapper as the default actor transport.
8+
typealias DefaultActorTransport = AnyActorTransport
9+
710
distributed actor DA {
811
}
912

test/Distributed/distributed_actor_cannot_be_downcast_to_actor.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
import _Distributed
66

7+
/// Use the existential wrapper as the default actor transport.
8+
typealias DefaultActorTransport = AnyActorTransport
9+
710
@available(SwiftStdlib 5.6, *)
811
extension Actor {
912
func f() -> String { "Life is Study!" }

test/Distributed/distributed_actor_func_implicitly_async_throws.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
import _Distributed
66

7+
/// Use the existential wrapper as the default actor transport.
8+
typealias DefaultActorTransport = AnyActorTransport
9+
710
@available(SwiftStdlib 5.6, *)
811
distributed actor D {
912

0 commit comments

Comments
 (0)