=act #3572 Add parens to sender
* because it is not referentially transparent; normally we reserved parens for side-effecting code but given how people thoughtlessly close over it we revised that that decision for sender * caller can still omit parens
This commit is contained in:
parent
537840bd2a
commit
a11fb1dafc
202 changed files with 631 additions and 620 deletions
|
|
@ -34,7 +34,7 @@ object FaultHandlingDocSpec {
|
|||
//#strategy
|
||||
|
||||
def receive = {
|
||||
case p: Props => sender ! context.actorOf(p)
|
||||
case p: Props => sender() ! context.actorOf(p)
|
||||
}
|
||||
}
|
||||
//#supervisor
|
||||
|
|
@ -56,7 +56,7 @@ object FaultHandlingDocSpec {
|
|||
//#strategy2
|
||||
|
||||
def receive = {
|
||||
case p: Props => sender ! context.actorOf(p)
|
||||
case p: Props => sender() ! context.actorOf(p)
|
||||
}
|
||||
// override default to kill all children during restart
|
||||
override def preRestart(cause: Throwable, msg: Option[Any]) {}
|
||||
|
|
@ -87,7 +87,7 @@ object FaultHandlingDocSpec {
|
|||
def receive = {
|
||||
case ex: Exception => throw ex
|
||||
case x: Int => state = x
|
||||
case "get" => sender ! state
|
||||
case "get" => sender() ! state
|
||||
}
|
||||
}
|
||||
//#child
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue