Aladdin - Scala Bugtracking
[#1227] project: interpreter priority: low category: bug
submitter assigned to status date submitted
Nikolay Martin fixed 2007-07-18 22:30:48.0
subject [contrib #700] 'new' operator with missing classname crashes interpreter
code
scala> new {}
what happened
scala> new {}
Exception in thread "main" java.util.NoSuchElementException: tail of empty list
        at scala.Nil$.tail(List.scala:1165)
        at scala.tools.nsc.ast.parser.TreeBuilder.makeNew(TreeBuilder.scala:143)
        at scala.tools.nsc.ast.parser.Parsers$Parser.simpleExpr(Parsers.scala:1179)
        at scala.tools.nsc.ast.parser.Parsers$Parser.prefixExpr(Parsers.scala:1135)
        at scala.tools.nsc.ast.parser.Parsers$Parser.postfixExpr(Parsers.scala:1087)
        at scala.tools.nsc.ast.parser.Parsers$Parser.expr(Parsers.scala:1022)
        at scala.tools.nsc.ast.parser.Parsers$Parser$$anonfun$28.apply(Parsers.scala:2322)
        at scala.tools.nsc.ast.parser.Parsers$Parser$$anonfun$28.apply(Parsers.scala:2318)
        at scala.tools.nsc.ast.parser.Parsers$Parser.checkNoEscapingPlaceholders(Parsers.scala:152)
        at scala.tools.nsc.ast.parser.Parsers$Parser.templateStatSeq(Parsers.scala:2318)
        at scala.tools.nsc.Interpreter$$anonfun$7.simpleParse$0(Interpreter.scala:345)
        at scala.tools.nsc.Interpreter$$anonfun$7.apply(Interpreter.scala:352)
        at scala.tools.nsc.Interpreter$$anonfun$7.apply(Interpreter.scala:338)
        at scala.tools.nsc.reporters.Reporter.withIncompleteHandler(Reporter.scala:55)
        at scala.tools.nsc.Interpreter.scala$tools$nsc$Interpreter$$parse(Interpreter.scala:338)
        at scala.tools.nsc.Interpreter.interpret(Interpreter.scala:426)
        at scala.tools.nsc.InterpreterLoop.interpretStartingWith(InterpreterLoop.scala:235)
        at scala.tools.nsc.InterpreterLoop.command(InterpreterLoop.scala:222)
        at scala.tools.nsc.InterpreterLoop.repl(InterpreterLoop.scala:135)
        at scala.tools.nsc.InterpreterLoop.main(InterpreterLoop.scala:273)
        at scala.tools.nsc.MainGenericRunner$.main(MainGenericRunner.scala:131)
        at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
what expected An appropriate error.
[back to overview]
Changes of this bug report
Nikolay  edited on  2007-07-18 22:31:07.0
Martin  edited on  2007-07-19 13:57:48.0
I changed so that this is now equivalent to new AnyRef {}.
Nikolay  edited on  2007-07-19 14:03:33.0
But didn't you fix it? why is it still open?
Martin  edited on  2007-07-19 14:31:58.0