i have a function which returns generics:
def getArray(tag: Tags, arr: Option[Array[SearchHit]]
): Array[_ >: CustomerInfoDTO[CustomerApplicationIdDTO] with CustomerIdDTO <: Serializable] = arr match {
case Some(s) =>
tag match {
case GetCustomersInfo =>
s.map(x => extractCustomerInfo(x.sourceAsString))
case GetCustomersId =>
s.map(x => extractCustomerId(x.sourceAsString))
case _ => throw new NoSuchElementException("Can't match tag")
}
case None => throw new NoSuchElementException("Empty Array")
}
so, my problem when i'm trying to match a fuction result:
case arr: Array[CustomerInfoDTO[CustomerApplicationIdDTO]] =>
i'm getting a warning "non-variable type argument CustomerApplicationIdDTO in type pattern Array[CustomerInfoDTO[CustomerApplicationIdDTO]] is unchecked since it is eliminated by erasure"
Is it means, that in Array[] it possible to get array of any type? So i have readed about ClassTag and TypeTag, but misunderstood how to use it in my case. So can you help me? how to handle this warning?