Aladdin - Scala Bugtracking
[#643] project: compiler priority: medium category: bug
submitter assigned to status date submitted
Burak Martin fixed 2006-06-27 12:37:55.0
subject UnCurry messes with Seq in pattern match
code
object foo {
  val d = <D>Somevalue</D>
  d match {
    case <D>{ v }</D> =>
      Console println v
  }
}
what happened
package  {
  final class foo extends java.lang.Object with scala.ScalaObject {
    def this(): object foo = {
      foo.super.this();
      ()
    };
    private  val d : scala.xml.Elem = {
      {
        new scala.xml.Elem.this(null, "D", scala.xml.Null, scala.this.Predef.$scope(), new scala.xml.NodeBuffer.\
this().&+(new scala.xml.Text.this("Somevalue")).toList())
      }
    };
      def d(): scala.xml.Elem = foo.this.d ;
    foo.this.d() match {
      case (scala.Seq[scala.xml.Node])scala.xml.Elem(Array[scala.xml.Node]{
(java.lang.String,java.lang.String,scala.xml.MetaData,scala.xml.NamespaceBinding,scala.Seq[scala.xml.Node])scala\
.xml.Elem(_, "D", _, _, Array[scala.xml.Node]{(v @ _)})}
      ) => scala.Console.println(v)
    }
  }
}


With the present behavior, the pattern an invalid Scala tree, which TransMatch translates to an always failing p\ attern match.
what expected UnCurry should not transform the constructor pattern Seq to the constructor patterm Elem. It would be fair to either leave it as it is, or use NodeSeq.
[back to overview]
Changes of this bug report
Burak  edited on  2006-06-27 12:38:54.0
I tracked it down to UnCurry::postTransform
Burak  edited on  2006-06-27 14:15:41.0
seems to be same as bug #401
Martin  edited on  2006-06-29 00:23:01.0
Fixed (and yes, it is the same as bug 401). We now follow Burak's suggestion. However xmlstuff breaks in the test suite. Burak, can you have a look to find out why?
Martin  edited on  2006-06-29 00:23:43.0
Burak  edited on  2006-06-29 11:21:17.0
The problematic lines appear isolated in the new #646