-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed as not planned
Closed as not planned
Copy link
Labels
Description
Compiler version
3.3.7-RC1
Minimized code
https://github.com/apache/pekko/actions/runs/17338073097/job/49227565939?pr=2104
final def scheduleOnce(delay: FiniteDuration, receiver: ActorRef, message: Any)(
implicit
executor: ExecutionContext,
sender: ActorRef = Actor.noSender): Cancellable
Output
[error] -- [E220] Type Error: /home/runner/work/pekko/pekko/actor-tests/src/test/scala/org/apache/pekko/actor/SupervisorHierarchySpec.scala:242:70
[error] 242 | context.system.scheduler.scheduleOnce(1.second, self, Dump(0))(context.dispatcher)
[error] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[error] |Argument for implicit parameter sender was supplied using a default argument.
[error] |
[error] | longer explanation available when compiling with `-explain`
Expectation
Compiles ok
refs: #23559
The implicit ActorRef
is from the Actor
where:
/**
* The 'self' field holds the ActorRef for this actor.
* <p/>
* Can be used to send messages to itself:
* <pre>
* self ! message
* </pre>
*/
implicit final val self: ActorRef = context.self // MUST BE A VAL, TRUST ME
And then, when using the method inside the Actor, this will cause an error. I think the value should be bound to self
and no warning.