trait A[C[_]]{
def id: Int
}
object B1{
def unapply(id: Int): Option[B1] = if(id == 1) Some(apply()) else None
}
case class B1() extends A[Iterable]{
val id = 1
}
object B2{
def unapply(id: Int): Option[B2] = if(id == 2) Some(apply()) else None
}
case class B2() extends A[Option]{
val id = 2
}
However when explicity typing pf with that signature leads to an error condition:
Multiple markers at this line
- class Option takes type parameters
- _$1 takes no type parameters,
expected: one
- type Iterable takes type parameters
--
You received this message because you are subscribed to the Google Groups "scala-language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-languag...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
According to REPL the return type of pf is: Product with Serializable with A[_ >: Iterable with Option <: Equals]