J Robert Ray wrote:
> Given:
>
> implicit def option2array[T](t : Option[T]) : Array[T] = t match {
> case Some(x) =>
> val a = new Array[T](1)
> a(0) = x
> a
>
> case None =>
> new Array[T](0)
> }
>
>
> This doesn't work implicitly:
>
> def f : Array[Int] = Some(5)
>
> error: no type parameters for method Some: (A)Some[A] exist so that it
> can be applied to arguments (Int)
> --- because ---
> result type Some[A] is incompatible with expected type Array[Int]
This is a bug. I tried an old Scala compiler (2.6.0-RC2) and it worked,
then tried 2.6.1-final and received the same message as yourself.