Semantic highlighting: infix notation for extractors
Extractors aren't correctly highlighted when they occur in infix notation - instead they are shown in colors of operators or of something other (couldn't identify it):
object Test extends App {
val x :: y = 1 :: 2 :: Nil // wrong
val C(a, b) = N C 2 C 1 // correct
val c C d = N C 2 C 1 // wrong
}
trait L[+A] {
def C[B >: A](b: B): L[B] = new C(b, this)
}
case class C[A](h: A, t: L[A]) extends L[A]
case object N extends L[Nothing]
Leave a comment
on 2012-08-14 18:03 *
By Simon Schäfer
Description changed from Extractors doesn't have an ... to Extractors aren't correctly...
Summary changed from Semantic highlighting doesn't have a color for extractors to Semantic highlighting: infix notation for extractors
In the first line, the
In the second line, the first
In the third line, the first
@sschaef, I'm not following what would be your expectation? To have all of them marked as a case class, or class?
::
is marked as an operator.In the second line, the first
C
is marked as a case class.In the third line, the first
C
is marked as an 'others'.@sschaef, I'm not following what would be your expectation? To have all of them marked as a case class, or class?
on 2014-02-04 11:59 *
By Simon Schäfer
My expectation is that all of them are marked as case classes, because that is what they are in the example. If someone writes an unapply method manually it should be shown as a normal class.
on 2014-03-11 13:21 *
By huitseeker
Version changed from 2.1.0-nightly-210 to 3.0.2-210
Status changed from Need Info to Accepted