Aladdin - Scala Bugtracking
[#385] project: compiler priority: low category: bug
submitter assigned to status date submitted
Philippe Burak fixed 2004-12-13 18:32:39.0
subject The character sequence ``` crashes the parser
code
object Bug {
  val ``` = 0;
}
what happened
tmp/test.scala:2: unclosed string literal
  val ``` = 0;
        ^
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 0
	at java.lang.String.charAt(String.java:444)
	at scalac.util.Name.charAt(Name.java:91)
	at scala.tools.scalac.ast.parser.Parser$class.precedence(Parser.scala:462)
	at scala.tools.scalac.ast.parser.Parser$class.pattern3(Parser.scala:1324)
	at scala.tools.scalac.ast.parser.Parser$class.pattern2(Parser.scala:1273)
	at scala.tools.scalac.ast.parser.Parser$class.patDefOrDcl(Parser.scala:1740)
	at scala.tools.scalac.ast.parser.Parser$class.defOrDcl(Parser.scala:1697)
	at scala.tools.scalac.ast.parser.Parser$$anon$7.apply(Parser.scala:2085)
	at scala.tools.scalac.ast.parser.Parser$$anon$7.apply(Parser.scala:2085)
	at scala.tools.scalac.ast.parser.Parser$class.joinComment(Parser.scala:173)
	at scala.tools.scalac.ast.parser.Parser$class.templateStatSeq(Parser.scala:2085)
	at scala.tools.scalac.ast.parser.Parser$class.templateBody(Parser.scala:2006)
	at scala.tools.scalac.ast.parser.Parser$class.classTemplate(Parser.scala:1963)
	at scala.tools.scalac.ast.parser.Parser$class.objectDef(Parser.scala:1933)
	at scala.tools.scalac.ast.parser.Parser$class.clsDef(Parser.scala:1724)
	at scala.tools.scalac.ast.parser.Parser$$anon$6.apply(Parser.scala:2058)
	at scala.tools.scalac.ast.parser.Parser$$anon$6.apply(Parser.scala:2058)
	at scala.tools.scalac.ast.parser.Parser$class.joinComment(Parser.scala:173)
	at scala.tools.scalac.ast.parser.Parser$class.topStatSeq(Parser.scala:2058)
	at scala.tools.scalac.ast.parser.Parser$class.compilationUnit(Parser.scala:2195)
	at scala.tools.scalac.ast.parser.Parser$class.parse(Parser.scala:64)
	at scala.tools.scalac.ast.parser.ParserPhase$class.apply(ParserPhase.scala:20)
	at scalac.CompilationLoop.loop(CompilationLoop.java:102)
	at scalac.CompilationLoop.compile(CompilationLoop.java:60)
	at scalac.Global.compile(Global.java:391)
	at scalac.Global.compile(Global.java:366)
	at scala.tools.scalac.Main$.main1(Main.scala:45)
	at scala.tools.scalac.Main$.main(Main.scala:28)
	at scala.tools.scalac.Main.main(Main.scala:28)
what expected No crash.
[back to overview]
Changes of this bug report
Burak  edited on  2004-12-16 15:02:47.0
Fixed, even unclosed string literals should not leave field name uninitialized.