In my Akka program I have an anonymous inner Actor (extra pattern) which internally waits for responses from storage actors who return a list of their respective domain object (i.e. List[MyDomain]
).
The anonymous actor's receive block waits for the response like so:
def receive = {
case a: List[MyDomain1] => originalSender ! a
case b: List[MyDomain2] => originalSender ! b
}
The problem is that I get erasure warnings:
Actors.scala:46: non-variable type argument domain.MyDomain1 in type pattern List[domain.MyDomain1] is unchecked since it is eliminated by erasure
(and another warning for the second case statement above).
How can I resolve this without introducing another type to represent the response from my storage actors? It makes sense that they return a List of their domain.