Problem with sortWith(_<_)

Hi.

If I do the following:


{code}

object Scratch {
  def main(args:Array[String]) {        
    val l = List(1,2,3)
    l.sortWith(_<_).head
  }
}


{code}

this code ").head" is highlighted in green and then idea's whole understanding of the file is broken. All classes that depend on this file are broken. Basically idea is unusable.

If I add a space after the < so that the line looks like this:

l.sortWith(_< _).head

it works fine. It also works if you have it the other way round:

l.sortWith(_>_).reverse.head

bug here: http://youtrack.jetbrains.com/issue/SCL-4348

Thanks, Nick.
0
2 comments

Plugin treats <_ as xml token start (it seems that it's because of wrong assumptions). So workaround is to use spaces as you described.
However thank  you for the report, we will try to fix it ASAP.

Best regards,
Alexander Podkhalyuzin.

0
Avatar
Permanently deleted user

Thanks for the update. Just so we're clear, this is a regression with the last couple of releases. Previously, the parsing worked.

Thanks, Nick.

0

Please sign in to leave a comment.