Burak edited on 2006-06-29 11:28:42.0
|
Here's an even simpler one
object xfor {
List(<a/>) match {
case t @ <a>Blabla</a> => t
}
}
which is of course equivalent (simplified the pattern a bit) to
object xfor {
List(<a/>) match {
case t @ Seq(scala.xml.Elem(_,"a",_,_,_*)) => t
}
}
|
Martin edited on 2006-07-11 16:15:57.0
|
I guess it was fixed by some previous change. It compiles OK now.
|
Burak edited on 2006-10-12 12:37:59.0
|
reopen! I guess the "fix" was due to my worsening the type by parsing it to Seq(Elem(...)) instead of Elem(...). This is unnecessary. Now that I made the parse use the better (more precise) pattern Elem (which is <: Node <: NodeSeq <: Seq), I would not expect this error message.
Note that the code below compiles fine -- should the refinement really matter for patterns? If yes, you could change the status from "bug" to "feature".
val n: NodeSeq = new NodeSeq { val theSeq = books.child }
n match {
case t @ Blabla => t
}
|
Martin edited on 2006-10-26 16:52:05.0
|
I get:
bug646.scala:13 error: constructor cannot be instantiated to expected type;
found : scala.xml.Elem
required: scala.xml.NodeSeq{def theSeq: scala.xml.Node*}
case t @ Blabla => t
^
one error found
Not sure whether that's correct or not. I reassigned to Burak.
|
Burak edited on 2007-03-03 03:01:16.0
|
|