Aladdin - Scala Bugtracking
[#989] project: compiler priority: low category: bug
submitter assigned to status date submitted
Nikolay Lex fixed 2007-03-12 08:58:22.0
subject [contrib #364] Bad character literal interpreter crash
code
scala> '42'
what happened
Compiler crash:

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 7
        at scala.tools.nsc.util.CharArrayReader.next(CharArrayReader.scala:53)
        at scala.tools.nsc.ast.parser.Scanners$Scanner.getlitch(Scanners.scala:650)
        at scala.tools.nsc.ast.parser.Scanners$Scanner.fetchToken(Scanners.scala:339)
        at scala.tools.nsc.ast.parser.Scanners$Scanner.nextToken(Scanners.scala:146)
        at scala.tools.nsc.ast.parser.Scanners$Scanner.skipToken(Scanners.scala:114)
        at scala.tools.nsc.ast.parser.Parsers$Parser.literal(Parsers.scala:516)
        at scala.tools.nsc.ast.parser.Parsers$Parser.simpleExpr(Parsers.scala:1029)
        at scala.tools.nsc.ast.parser.Parsers$Parser.prefixExpr(Parsers.scala:1008)
        at scala.tools.nsc.ast.parser.Parsers$Parser.postfixExpr(Parsers.scala:961)
        at scala.tools.nsc.ast.parser.Parsers$Parser.expr(Parsers.scala:908)
        at scala.tools.nsc.ast.parser.Parsers$Parser.templateStatSeq(Parsers.scala:2145)
        at scala.tools.nsc.Interpreter$$anonfun$5.simpleParse$0(Interpreter.scala:187)
        at scala.tools.nsc.Interpreter$$anonfun$5.apply(Interpreter.scala:192)
        at scala.tools.nsc.Interpreter$$anonfun$5.apply(Interpreter.scala:181)
        at scala.tools.nsc.reporters.Reporter.withIncompleteHandler(Reporter.scala:62)
        at scala.tools.nsc.Interpreter.scala$tools$nsc$Interpreter$$parse(Interpreter.scala:181)
        at scala.tools.nsc.Interpreter.interpret(Interpreter.scala:270)
        at scala.tools.nsc.InterpreterLoop.interpretStartingWith(InterpreterLoop.scala:211)
        at scala.tools.nsc.InterpreterLoop.command(InterpreterLoop.scala:198)
        at scala.tools.nsc.InterpreterLoop.repl(InterpreterLoop.scala:111)
        at scala.tools.nsc.InterpreterLoop.main(InterpreterLoop.scala:246)
        at scala.tools.nsc.MainGenericRunner$.main(MainGenericRunner.scala:92)
        at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)

what expected Error message, e.g. "Bad character literal '42'"
[back to overview]
Changes of this bug report
Nikolay  edited on  2007-03-12 08:59:47.0
contribution #364. I assigned it to Lex because it only crashes the interpreter. The compiler spits out 2 error messages.
Lex  edited on  2007-03-16 13:06:33.0