I've got a sequence Seq[Any] that has a variety of objects in it (like String, Integer, List[String], etc). I'm trying to sift through the list and break it up into separate lists partitioned based on the class type. The following is a pattern I'm using in the code:
val allApis = mySequence.filter(_.isInstanceOf[String])
This works well and doesn't generate any warnings. However, when I try to do the same for filtering out the objects that are Lists of strings:
val allApis = mySequence.filter(_.isInstanceOf[List[String]])
I get a warning that says non-variable type argument String in type List[String] is unchecked since it is eliminated by erasure. Now, the technique actually works and I'm able to comfortably filter the sequence as desired, but I'm wondering what is the appropriate way to deal with the warning in an idiomatic way so that I know I don't have a serious bug lurking in the background waiting to blow up