Skip to content

Commit 14c432c

Browse files
committed
cleanup
1 parent d4df6a3 commit 14c432c

File tree

5 files changed

+5
-26
lines changed

5 files changed

+5
-26
lines changed

test/Distributed/Runtime/distributed_actor_remote_functions.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ struct FakeTransport: ActorTransport {
151151

152152
func resolve<Act>(_ identity: AnyActorIdentity, as actorType: Act.Type) throws -> Act?
153153
where Act: DistributedActor {
154-
return nil
154+
nil
155155
}
156156

157157
func assignIdentity<Act>(_ actorType: Act.Type) -> AnyActorIdentity

test/Distributed/actor_protocols.swift

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@ import _Distributed
66

77
// ==== -----------------------------------------------------------------------
88

9-
@available(SwiftStdlib 5.5, *)
109
actor A: Actor {} // ok
1110

12-
@available(SwiftStdlib 5.5, *)
1311
class C: Actor, UnsafeSendable {
1412
// expected-error@-1{{non-actor type 'C' cannot conform to the 'Actor' protocol}} {{1-6=actor}}
1513
// expected-warning@-2{{'UnsafeSendable' is deprecated: Use @unchecked Sendable instead}}
@@ -18,15 +16,13 @@ class C: Actor, UnsafeSendable {
1816
}
1917
}
2018

21-
@available(SwiftStdlib 5.5, *)
2219
struct S: Actor {
2320
// expected-error@-1{{non-class type 'S' cannot conform to class protocol 'Actor'}}
2421
nonisolated var unownedExecutor: UnownedSerialExecutor {
2522
fatalError()
2623
}
2724
}
2825

29-
@available(SwiftStdlib 5.5, *)
3026
struct E: Actor {
3127
// expected-error@-1{{non-class type 'E' cannot conform to class protocol 'Actor'}}
3228
nonisolated var unownedExecutor: UnownedSerialExecutor {
@@ -36,10 +32,8 @@ struct E: Actor {
3632

3733
// ==== -----------------------------------------------------------------------
3834

39-
@available(SwiftStdlib 5.5, *)
4035
distributed actor DA: DistributedActor {} // ok
4136

42-
@available(SwiftStdlib 5.5, *)
4337
actor A2: DistributedActor {
4438
// expected-error@-1{{non-distributed actor type 'A2' cannot conform to the 'DistributedActor' protocol}} {{1-1=distributed }}
4539
nonisolated var id: AnyActorIdentity {
@@ -58,7 +52,6 @@ actor A2: DistributedActor {
5852
}
5953
}
6054

61-
@available(SwiftStdlib 5.5, *)
6255
class C2: DistributedActor {
6356
// expected-error@-1{{non-actor type 'C2' cannot conform to the 'Actor' protocol}}
6457
// expected-error@-2{{non-final class 'C2' cannot conform to 'Sendable'; use '@unchecked Sendable'}}
@@ -77,7 +70,6 @@ class C2: DistributedActor {
7770
}
7871
}
7972

80-
@available(SwiftStdlib 5.5, *)
8173
struct S2: DistributedActor {
8274
// expected-error@-1{{non-class type 'S2' cannot conform to class protocol 'DistributedActor'}}
8375
// expected-error@-2{{non-class type 'S2' cannot conform to class protocol 'AnyActor'}}

test/Distributed/distributed_actor_basic.swift

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,15 @@
44

55
import _Distributed
66

7-
@available(SwiftStdlib 5.5, *)
87
distributed actor DA {
98
}
109

11-
@available(SwiftStdlib 5.5, *)
1210
distributed actor First {
1311
distributed func one(second: Second) async throws {
1412
try await second.two(first: self, second: second)
1513
}
1614
}
1715

18-
@available(SwiftStdlib 5.5, *)
1916
distributed actor Second {
2017
distributed func two(first: First, second: Second) async {
2118
try! await first.one(second: self)
@@ -24,15 +21,13 @@ distributed actor Second {
2421

2522
// ==== ------------------------------------------------------------------------
2623

27-
@available(SwiftStdlib 5.5, *)
2824
extension First {
2925
@_dynamicReplacement (for :_remote_one(second:))
3026
nonisolated func _impl_one(second: Second) async throws {
3127
fatalError()
3228
}
3329
}
3430

35-
@available(SwiftStdlib 5.5, *)
3631
extension Second {
3732
@_dynamicReplacement (for :_remote_two(first:second:))
3833
nonisolated func _impl_two(first: First, second: Second) async throws {

test/Distributed/distributed_actor_is_experimental.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,9 @@
55

66
actor SomeActor {}
77

8-
@available(SwiftStdlib 5.5, *)
98
distributed actor DA {}
109
// expected-error@-1{{'distributed' modifier is only valid when experimental distributed support is enabled}}
1110

12-
@available(SwiftStdlib 5.5, *)
1311
distributed actor class DAC {}
1412
// expected-error@-1{{'distributed' modifier is only valid when experimental distributed support is enabled}}
1513
// expected-error@-2{{keyword 'class' cannot be used as an identifier here}}
@@ -27,7 +25,6 @@ actor A {
2725
}
2826
}
2927

30-
@available(SwiftStdlib 5.5, *)
3128
distributed actor DA2 {
3229
// expected-error@-1{{'distributed' modifier is only valid when experimental distributed support is enabled}}
3330
func normal() async {}

test/Distributed/distributed_actor_isolation.swift

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
1-
// RUN: %target-typecheck-verify-swift -enable-experimental-distributed -disable-availability-checking
1+
// RUN: %target-typecheck-verify-swift -enable-experimental-distributed -disable-availability-checking -verify-ignore-unknown
22
// REQUIRES: concurrency
33
// REQUIRES: distributed
44

5+
// TODO(distributed): rdar://82419661 remove -verify-ignore-unknown here, no warnings should be emitted for our
6+
// generated code but right now a few are, because of Sendability checks -- need to track it down more.
7+
58
import _Distributed
69

7-
@available(SwiftStdlib 5.5, *)
810
struct ActorAddress: ActorIdentity {
911
let address: String
1012
init(parse address : String) {
1113
self.address = address
1214
}
1315
}
1416

15-
@available(SwiftStdlib 5.5, *)
1617
actor LocalActor_1 {
1718
let name: String = "alice"
1819
var mutable: String = ""
@@ -24,7 +25,6 @@ actor LocalActor_1 {
2425

2526
struct NotCodableValue { }
2627

27-
@available(SwiftStdlib 5.5, *)
2828
distributed actor DistributedActor_1 {
2929

3030
let name: String = "alice" // expected-note{{distributed actor state is only available within the actor instance}}
@@ -120,7 +120,6 @@ distributed actor DistributedActor_1 {
120120
}
121121
}
122122

123-
@available(SwiftStdlib 5.5, *)
124123
func test_outside(
125124
local: LocalActor_1,
126125
distributed: DistributedActor_1
@@ -151,22 +150,18 @@ func test_outside(
151150

152151
// ==== Protocols and static (non isolated functions)
153152

154-
@available(SwiftStdlib 5.5, *)
155153
protocol P {
156154
static func hello() -> String
157155
}
158-
@available(SwiftStdlib 5.5, *)
159156
extension P {
160157
static func hello() -> String { "" }
161158
}
162159

163-
@available(SwiftStdlib 5.5, *)
164160
distributed actor ALL: P {
165161
}
166162

167163
// ==== Codable parameters and return types ------------------------------------
168164

169-
@available(SwiftStdlib 5.5, *)
170165
func test_params(
171166
distributed: DistributedActor_1
172167
) async throws {

0 commit comments

Comments
 (0)