Product is a very abstract high level type with very few restrictions. When the output type is Product , this usually indicates that you made a mistake. For example. if you have:
List((1, "hi", 0.4f), (2, "bye"), (3, "aloha", 7.2f))
This then compiles in order, giving you a List[Product] . But, as and when Any output, this is probably a mistake - you probably meant that it was List[(Int, String, Float)] and meant that it had a third record in the middle tuple.
If you really want List[Product] , you can avoid the warning about this by explicitly specifying an argument of the type:
List[Product]((1, "hi", 0.4f), (2, "bye"), (3, "aloha", 7.2f))
lmm
source share