Option flatten does not use an implicit conversion

Bruno Bieth <[email protected]> Fri, 4 Mar 2016 02:33:36 -0800 (PST)
Newsgroups gmane.comp.lang.scala
Message-ID <[email protected]>
I was surprised that Some(Success(1)).flatten does not compile?
What is the rationale behind this:

def flatten[B](implicit ev: A <:< Option[B]): Option[B] = if (isEmpty) None 
else ev(this.get)

Why not having an implicit conversion: (implicit conv: A => Option[B])?

Bruno

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.