I am using scala.Serializable, but when i invoke String.asInstanceOf[Serializable], class cast exception is thrown. Here is my code, pretty simple.
arguments.map(_.asInstanceOf[Serializable])
Yes, arguments is array of string of course
I am run the application with scala-ide for eclipse with eclipse 3.7 and scala 2.9.0-1
looking into this documentation scala doc
The Problem now is “what is the typical use case of scala.Serializable”
That’s because java.lang.String does not implement scala.Serializable. There are no dependencies from Java to Scala.
I think you’ll find you don’t need any cast, as java.lang.String does implement java.io.Serializable, but perhaps the context you omitted would make that clear.