forked from swiftlang/swift
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdistributed_actor_is_experimental.swift
41 lines (33 loc) · 1.75 KB
/
distributed_actor_is_experimental.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// RUN: %target-typecheck-verify-swift -disable-availability-checking
// ^^^^ notice the, on purpose, missing '-enable-experimental-distributed'
// REQUIRES: concurrency
// REQUIRES: distributed
actor SomeActor {}
distributed actor DA {}
// expected-error@-1{{'distributed' modifier is only valid when experimental distributed support is enabled}}
distributed actor class DAC {}
// expected-error@-1{{'distributed' modifier is only valid when experimental distributed support is enabled}}
// expected-error@-2{{keyword 'class' cannot be used as an identifier here}}
actor A {
func normal() async {}
distributed func dist() {}
// expected-error@-1{{'distributed' modifier is only valid when experimental distributed support is enabled}}
distributed func distAsync() async {}
// expected-error@-1{{'distributed' modifier is only valid when experimental distributed support is enabled}}
distributed var neverOk: String {
// expected-error@-1{{'distributed' modifier is only valid when experimental distributed support is enabled}}
"vars are not allowed to be distributed *ever* anyway"
}
}
distributed actor DA2 {
// expected-error@-1{{'distributed' modifier is only valid when experimental distributed support is enabled}}
func normal() async {}
distributed func dist() {}
// expected-error@-1{{'distributed' modifier is only valid when experimental distributed support is enabled}}
distributed func distAsync() async {}
// expected-error@-1{{'distributed' modifier is only valid when experimental distributed support is enabled}}
distributed var neverOk: String {
// expected-error@-1{{'distributed' modifier is only valid when experimental distributed support is enabled}}
"vars are not allowed to be distributed *ever* anyway"
}
}