Aladdin - Scala Bugtracking
[#542] project: compiler priority: low category: bug
submitter assigned to status date submitted
Sean Burak fixed 2006-03-03 18:00:29.0
subject XML compiler crash
code
          for (val top <- modules.elements.toList) yield 
            <TR><TD class="signature">
            <CODE>{Text("package")}
            {(aref(urlFor(top._2), "_self", top._2.fullNameString('.')))}<CODE>;
            </TD></TR>;
what happened
The code is ill-formed because the last <CODE> should really be a </CODE>, putting this code through the c\
ompiler causes a crashes:
scala.MatchError: _
	at scala.tools.nsc.ast.parser.TreeBuilder.makeValue$0(TreeBuilder.scala:244)
	at scala.tools.nsc.ast.parser.TreeBuilder$$anonfun$6.apply(TreeBuilder.scala:269)
	at scala.tools.nsc.ast.parser.TreeBuilder$$anonfun$6.apply(TreeBuilder.scala:269)
	at scala.List.map(List.scala:664)
	at scala.tools.nsc.ast.parser.TreeBuilder.makeFor(TreeBuilder.scala:269)
	at scala.tools.nsc.ast.parser.TreeBuilder.makeFor(TreeBuilder.scala:281)
	at scala.tools.nsc.ast.parser.Parsers$Parser.expr(Parsers.scala:691)
	at scala.tools.nsc.ast.parser.MarkupParsers$MarkupParser.xEmbeddedExpr(MarkupParsers.scala:489)
	at
...
what expected Shouldn't crash. Fixing the syntax error makes the crash go away.
[back to overview]
Changes of this bug report
Burak  edited on  2006-03-06 11:53:56.0
That's strange, compiling the following code:
for (val top <- List(<a/>)) yield 
    <TR><TD class="signature">
     <CODE>{Text("package")}
      {"blabla"}<CODE>;
  </TD></TR>;
yields the error message: [emir@lamppc31 /tmp]$ scalac -d . test.scala test.scala:18 error: in XML literal: expected closing tag of
CODE
      {"blabla"}<CODE>;
                ^
I am not sure how I can track this bug down. Do you have an example that crashes the compiler which I can reproduce?
Burak  edited on  2006-10-11 14:50:26.0
did some formatting to this report so it is easier to read.
Burak  edited on  2006-10-23 14:40:42.0
error handling got improved recently. the result on program
object foo {
for (val top <- List()) yield
    <TR><TD class="signature">
             <CODE>{Text("package")}
                       {"blabla"}<CODE>;
                             </TD></TR>;
                                 }


is now /tmp/bo.scala:6 error: in XML literal: expected closing tag of CODE </TD></TR>; ^ /tmp/bo.scala:6 error: in XML literal: '>' expected instead of '<' </TD></TR>; ^ /tmp/bo.scala:7 error: in XML literal: in XML content, please use '}}' to express '}' } ^ /tmp/bo.scala:4 error: missing end tag in XML literal for <CODE> <CODE>{Text("package")} ^ /tmp/bo.scala:5 error: ';' expected but something found. {"blabla"}<CODE>; ^ /tmp/bo.scala:9 error: '}' expected but eof found. ^ 6 errors found
Burak  edited on  2006-10-23 14:41:27.0
is now
/tmp/bo.scala:6 error: in XML literal: expected closing tag of CODE
                             </TD></TR>;
                                 ^
...