He-Pin commented on code in PR #3060:
URL: https://github.com/apache/pekko/pull/3060#discussion_r3409460500
##########
actor-testkit-typed/src/test/scala/org/apache/pekko/actor/testkit/typed/scaladsl/BehaviorTestKitSpec.scala:
##########
@@ -126,7 +126,8 @@ object BehaviorTestKitSpec {
replyTo ! Done
Behaviors.same
case CreateMessageAdapter(messageClass, f, replyTo) =>
- val adaptor = context.messageAdapter(f)(ClassTag(messageClass))
+ implicit val ct: ClassTag[Any] = ClassTag(messageClass)
+ val adaptor = context.messageAdapter[Any](f.asInstanceOf[Any =>
Command])
Review Comment:
Agreed, the `asInstanceOf` cast was a workaround for Scala 3.8 context bound
desugaring. It has been reverted to the original
`context.messageAdapter(f)(ClassTag(messageClass))` pattern in commit
683f8740c3 — the explicit ClassTag passing still works correctly in Scala 3.8
since `using` parameters can be passed positionally. The refactored
`ClassTag[U]` version did not compile on Scala 2.13 because `U` is erased in
pattern matching.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]