Aladdin - Scala Bugtracking
[#246] project: compiler priority: high category: bug
submitter assigned to status date submitted
Burak Martin fixed 2003-12-03 14:08:28.0
subject parser bug, sequence creation
code
object create {
  val z = 1;
  val y = 2;
  
    val zy = List( z, y );    // ok
    val zy2 = List( zy:_* );  // ok

  // (a) illegal, but passes the parser
  // crashes in uncurry later on
    val oops = List( zy:_*, 2,3,4 );

 // (b) should be legal, but passes not
    val help = List( 2,3,4, zy:_* );
}
what happened
see code. 

Actually the comment of Parser.exprs() agrees with (a), but not the implementation.
Due to iterated types being allowed as last arguments, escaping of sequences should be allowed also there,
what expected
Exprs ::= Expr {`,' Expr} [`:' `_' `*']
(or corresponding rule in postfixExpr() case...)
[back to overview]
Changes of this bug report
Burak  edited on  2003-12-03 14:09:09.0
priority of this is high, because the totality of scala XML processing depends on this.
Burak  edited on  2003-12-03 16:44:05.0
I fixed Parser.java and Parser.scala myself, since the (trivial) escaping code in UnCurry did already the right thing so later phases are untouched.
Any objections ?
Burak  edited on  2003-12-03 18:19:51.0
Well, UnCurry needed a slight change as well, in order to repeat (forbidden) mixing of :_* with values. E.g.
List(1,2,3,otherlist:_*)
is not possible, though we could do something about it.