I’m trying to write a generic debug print of a session variable value. I typically use strings and sequences of strings, only. When it is a string, I will just dump the value. When it is a sequence, I want to make it look like a bullet list on the console.
Here’s my code (so far):
def ValueOf( s : SessionVariable ) : ( Session => Validation[Session] ) = session => { println( "\n===========================================================================" ) println( "DEBUG - Value of Session Variable:" + s ) println( "---------------------------------------------------------------------------" ) val v = session( s ).as[Any] println( v match { case s : String => s case seq : Seq[String] => " - " + seq.mkString( ",\n - " ) case x => x.toString }) println( "===========================================================================" ) session }
And the compile warning I get is:
... non-variable type argument String in type pattern Seq[String] (the underlying of Seq[String]) is unchecked since it is eliminated by erasure [warn] case seq : Seq[String] => " - " + seq.mkString( ",\n - " ) [warn] ^ [warn] one warning found
Can anyone tell me what is the RIGHT way of doing what I am trying to accomplish?