Guest User

Untitled

a guest
May 15th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.44 KB | None | 0 0
  1. scala> val l = Set(Right(1), Left("a"), Right(3), Left("b"))
  2. l: scala.collection.immutable.Set[Product with Serializable with Either[java.lang.String,Int]] = Set(Right(1), Left(a), Right(3), Left(b))
  3.  
  4. scala> for (e <- l; n <- e.right) yield n
  5. <console>:9: error: type mismatch;
  6.  found   : Product with Either[java.lang.String,Int] with Serializable
  7.  required: scala.collection.GenTraversableOnce[?]
  8.               for (e <- l; n <- e.right) yield n
Add Comment
Please, Sign In to add comment