-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Seq pattern match does not work in action #154
Comments
Pretty weird syntax: For parser: object Parser extends SimpleParser {
def id: Rule1[String] = rule {
capture(CharPredicate.Printable -- '.')
}
def InputLine = rule {
(id.+ ~ ch('.')) ~> ((ids: Seq[String]) => ids match {
case Seq(single) => MATCH
case _ => MISMATCH
}
)
}
} really weird code is generated: // ... cut
if (l)
{
val start = __psi.cursor;
try {
val ids = __psi.valueStack.pop().asInstanceOf[scala.collection.immutable.Seq[String]];
ids match {
case collection.this.Seq.unapplySeq[String](<unapply-selector>) <unapply> ((single @ _)) => true
case _ => try {
__psi.registerMismatch()
} catch {
case _root_.org.parboiled2.ParserStateImpl.StartTracingException => __psi.bubbleUp(RuleTrace.MISMATCH)
}
}
} catch {
case (e @ (_: _root_.org.parboiled2.ParserStateImpl[(_ @ <empty>)]#TracingBubbleException)) => e.bubbleUp(RuleTrace.Action, start)
}
}
else
false
// ... cut @sirthias, have you seen this before? |
|
I ran into the same issue, with the following (not self contained, sorry) code:
It worked in Scala 2.10.4. Then I bumped versions to 2.11.7 and this issue appeared (among others). |
Compile fails with message:
Error:scalac: unexpected UnApply collection.this.Seq.unapplySeq[String](<unapply-selector>) <unapply> ((single @ _))
The text was updated successfully, but these errors were encountered: