Bug recognizing for-comprehensions?

This code compiles fine, so it's not a code bug. Here are the details:

abstract class BugDemo {
  import BugDemo._

  def collection: List[Int]
  def buggedfFunction(filter: Filter) = for (filter(elem) <- neighbors) yield elem

object BugDemo {
  class Filter(f: (Int) => Option[Int]) {
    def unapply(t: Int): Option[Int] = f(t)

I get a "cannot resolve symbol filter". Should I make a formal bug report?

1 comment
Comment actions Permalink

You can do report to http://youtrack.jetbrains.net/issues/SCL
For full report, it would be good to know Type of symbol neighbors (real, and IDEA's Type Inference).
And also it's important to know, what Scala compiler you are using.

Best regards,
Alexander Podkhalyuzin.


Please sign in to leave a comment.