Type Inference Problem

I am using IDEA 123.67 with Scala Plug-in 0.6.371. While below object compiles and runs successfully,


object Test {
  def subsets[T](xs: Set[T]): Set[Set[T]] =
    if (xs.isEmpty) Set(xs)
    else {
      val ys = subsets(xs.tail)
      ys ++ ys.map(_ + xs.head)
    }
}



Syntax highlighting displays errors for the following elements:

for `+':
     Cannot resolve symbol +

for `xs.head':
     Type mismatch, expected: Nothing, actual: T      Type mismatch, expected: String, actual: T      Unspecified value parameters: elem2: Nothing


Any ideas?

0
1 comment

It's http://youtrack.jetbrains.com/issue/SCL-4163
It was fixed in 0.6.375.

Best regards,
Alexander Podkhalyuzin.

0

Please sign in to leave a comment.