You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// expected-note@-1{{distributed actor state is only available within the actor instance}}
16
+
varvariable=12
17
+
varvariable_fromDetach=12 // expected-note{{distributed actor state is only available within the actor instance}}
18
+
letINITIALIZED:Int
19
+
letoutside:Int=1
20
+
21
+
init(transport:ActorTransport){
22
+
self.log =Logger(label:"name")
23
+
self.INITIALIZED =1
24
+
}
25
+
26
+
distributedfunc dist()->Int{}
27
+
28
+
func test(){
29
+
_ =self.id
30
+
_ =self.actorTransport
31
+
Task{
32
+
_ =self.id
33
+
_ =self.actorTransport
34
+
35
+
self.log.info("READY!")
36
+
_ =self.variable
37
+
_ =self.dist()
38
+
}
39
+
40
+
Task.detached{
41
+
_ =self.id
42
+
_ =self.actorTransport
43
+
44
+
// This is an interesting case, since we have a real local `self` and
45
+
// yet are not isolated to the same actor in this detached task...
46
+
// the call to it is implicitly async, however it is NOT implicitly throwing
47
+
// because we KNOW this is a local call -- and there is no transport in
48
+
// between that will throw.
49
+
_ =awaitself.dist() // notice lack of 'try' even though 'distributed func'
50
+
_ =self.variable_fromDetach // expected-error{{distributed actor-isolated property 'variable_fromDetach' can only be referenced inside the distributed actor}}
_ =Philosopher(transport: transport).log // expected-error{{distributed actor-isolated property 'log' can only be referenced inside the distributed actor}}
0 commit comments