Skip to content

Commit baf7587

Browse files
committed
1 parent 1431c15 commit baf7587

File tree

4 files changed

+20
-17
lines changed

4 files changed

+20
-17
lines changed

akka-actor-testkit-typed/src/test/java/akka/actor/testkit/typed/javadsl/BehaviorTestKitTest.java

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,8 @@ public interface Action {}
138138
i -> {
139139
context.spawn(childInitial, "child" + i);
140140
});
141-
return Behaviors.same();
141+
// https://github.com/lampepfl/dotty/issues/8631
142+
return (Behavior<Command>) (Object) Behaviors.same();
142143
})
143144
.onMessage(
144145
SpawnChildrenAnonymous.class,
@@ -148,7 +149,7 @@ public interface Action {}
148149
i -> {
149150
context.spawnAnonymous(childInitial);
150151
});
151-
return Behaviors.same();
152+
return (Behavior<Command>) (Object) Behaviors.same();
152153
})
153154
.onMessage(
154155
SpawnChildrenWithProps.class,
@@ -158,7 +159,7 @@ public interface Action {}
158159
i -> {
159160
context.spawn(childInitial, "child" + i, message.props);
160161
});
161-
return Behaviors.same();
162+
return (Behavior<Command>) (Object) Behaviors.same();
162163
})
163164
.onMessage(
164165
SpawnChildrenAnonymousWithProps.class,
@@ -168,28 +169,28 @@ public interface Action {}
168169
i -> {
169170
context.spawnAnonymous(childInitial, message.props);
170171
});
171-
return Behaviors.same();
172+
return (Behavior<Command>) (Object) Behaviors.same();
172173
})
173174
.onMessage(
174175
CreateMessageAdapter.class,
175176
message -> {
176177
context.messageAdapter(message.clazz, message.f);
177-
return Behaviors.same();
178+
return (Behavior<Command>) (Object) Behaviors.same();
178179
})
179180
.onMessage(
180181
SpawnWatchAndUnWatch.class,
181182
message -> {
182183
ActorRef<Action> c = context.spawn(childInitial, message.name);
183184
context.watch(c);
184185
context.unwatch(c);
185-
return Behaviors.same();
186+
return (Behavior<Command>) (Object) Behaviors.same();
186187
})
187188
.onMessage(
188189
SpawnAndWatchWith.class,
189190
message -> {
190191
ActorRef<Action> c = context.spawn(childInitial, message.name);
191192
context.watchWith(c, message);
192-
return Behaviors.same();
193+
return (Behavior<Command>) (Object) Behaviors.same();
193194
})
194195
.onMessage(
195196
SpawnSession.class,
@@ -202,14 +203,14 @@ public interface Action {}
202203
return Behaviors.same();
203204
}));
204205
message.replyTo.tell(session);
205-
return Behaviors.same();
206+
return (Behavior<Command>) (Object) Behaviors.same();
206207
})
207208
.onMessage(
208209
KillSession.class,
209210
message -> {
210211
context.stop(message.session);
211212
message.replyTo.tell(Done.getInstance());
212-
return Behaviors.same();
213+
return (Behavior<Command>) (Object) Behaviors.same();
213214
})
214215
.onMessage(
215216
Log.class,

akka-actor-typed-tests/src/test/java/akka/actor/typed/javadsl/ActorContextPipeToSelfTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public void handleAdaptedNull() {
8383
"complete-with-null",
8484
() -> {
8585
future.complete(null);
86-
return Behaviors.same();
86+
return (Behavior<String>) (Object) Behaviors.same();
8787
})
8888
.onAnyMessage(
8989
msg -> {

akka-actor-typed-tests/src/test/java/akka/actor/typed/javadsl/BehaviorBuilderTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,20 +45,20 @@ public void shouldCompile() {
4545
.onMessage(
4646
One.class,
4747
o -> {
48-
o.foo();
48+
((One) o).foo();
4949
return same();
5050
})
51-
.onMessage(One.class, o -> o.foo().startsWith("a"), o -> same())
51+
.onMessage(One.class, o -> ((One) o).foo().startsWith("a"), o -> same())
5252
.onMessageUnchecked(
5353
MyList.class,
54-
(MyList<String> l) -> {
55-
String first = l.get(0);
54+
/*(MyList<String> l)*/ l -> {
55+
String first = ((MyList<String>) l).get(0);
5656
return Behaviors.<Message>same();
5757
})
5858
.onSignal(
5959
Terminated.class,
6060
t -> {
61-
System.out.println("Terminating along with " + t.getRef());
61+
System.out.println("Terminating along with " + ((Terminated) t).getRef());
6262
return stopped();
6363
})
6464
.build();

akka-actor-typed-tests/src/test/java/akka/actor/typed/receptionist/ReceptionistApiTest.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
import akka.actor.typed.ActorRef;
88
import akka.actor.typed.ActorSystem;
9+
import akka.actor.typed.Behavior;
910
import akka.actor.typed.javadsl.AskPattern;
1011
import akka.actor.typed.javadsl.Behaviors;
1112

@@ -103,9 +104,10 @@ public void compileOnlyApiTest() {
103104
})
104105
.onMessage(
105106
Receptionist.Registered.class,
106-
registered -> registered.isForKey(key),
107+
registered -> ((Receptionist.Registered) registered).isForKey(key),
107108
registered -> {
108-
ActorRef<String> registree = registered.getServiceInstance(key);
109+
ActorRef<String> registree =
110+
((Receptionist.Registered) registered).getServiceInstance(key);
109111
return Behaviors.same();
110112
})
111113
.build();

0 commit comments

Comments
 (0)