I\'m coding against an API that gives me access to remote file system. The API returns a list of files and directories as list of node objects (parent to file and directory)
This is the long-standing issue 900 and has been discussed many times before. The common workaround is to use something like:
for (y@(_y:String) <- listOfBaseObjects) {
println(y)
}
A nicer version is provided by Jason Zaugg in the comments to the above-mentioned ticket:
object Typed { def unapply[A](a: A) = Some(a) }
for (Typed(y : String) <- listOfBaseObjects) {
println(y)
}