Based on my limited knowledge i know compiler automatically inherits the collection return type and based on that it determines the type of collection to return so in below code i want to return Option[Vector[String]]
.
I tried to experiment with below code and i get compilation error
type mismatch; found : scala.collection.immutable.Vector[String] required: Option[Vector[String]]
Code:
def readDocument(v:Option[Vector[String]]) : Option[Vector[String]] =
{
for ( a <- v;
b <- a )
yield
{
b
}
}