You missed that they are value classes. ;) Try:
val valueRef = system.actorOf { Props(classOf[ValueActor], 10) } On Thu, Dec 15, 2016 at 8:28 AM, Dmb <bunadmit...@gmail.com> wrote: > I'm reading the documentation > <http://doc.akka.io/docs/akka/2.4/scala/actors.html#Edge_cases> about > actors and now I'm at the section about actor creation. This is an example > I tried: > > >> case class MyValueClass(v: Int) extends AnyVal >> >> class ValueActor(v: MyValueClass) extends Actor { >> override def receive: Receive = { >> case _ => println("Received message") >> } >> } >> >> > When creating the actor as following: > > val valueRef = system.actorOf { >> Props(classOf[ValueActor], MyValueClass(10)) >> } >> >> > I actually got the *IllegalArgumentException*. But what's wrong with > that? To me, creating actors with value classes as parameters seems > completely innocent. What did I miss? > > -- > >>>>>>>>>> Read the docs: http://akka.io/docs/ > >>>>>>>>>> Check the FAQ: http://doc.akka.io/docs/akka/ > current/additional/faq.html > >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user > --- > You received this message because you are subscribed to the Google Groups > "Akka User List" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to akka-user+unsubscr...@googlegroups.com. > To post to this group, send email to akka-user@googlegroups.com. > Visit this group at https://groups.google.com/group/akka-user. > For more options, visit https://groups.google.com/d/optout. > -- Cheers, √ -- >>>>>>>>>> Read the docs: http://akka.io/docs/ >>>>>>>>>> Check the FAQ: >>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user --- You received this message because you are subscribed to the Google Groups "Akka User List" group. To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+unsubscr...@googlegroups.com. To post to this group, send email to akka-user@googlegroups.com. Visit this group at https://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.