NetLogo/NetLogo — Issue #16: attempting to use ?0 crashes compiler
Author: SethTisue
Created: 2011-11-05 00:11:56+00:00
State: open

this should give a nice error message instead:

```text
% make goshell
NetLogo 5.0RC4 (November 4, 2011)
print task [?0]
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: -1
at scala.collection.mutable.ResizableArray$class.apply(ResizableArray.scala:45)
at scala.collection.mutable.ArrayBuffer.apply(ArrayBuffer.scala:44)
at org.nlogo.prim._reportertask.getFormal(_reportertask.scala:25)
at org.nlogo.compiler.TaskVisitor.visitReporterApp(TaskVisitor.scala:33)
at org.nlogo.compiler.ReporterApp.accept(AstNode.scala:168)
at org.nlogo.compiler.DefaultAstVisitor$$anonfun$visitReporterApp$1.apply(AstVisitor.scala:27)
at org.nlogo.compiler.DefaultAstVisitor$$anonfun$visitReporterApp$1.apply(AstVisitor.scala:27)
at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:60)
at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:44)
at scala.collection.TraversableProxyLike$class.foreach(TraversableProxyLike.scala:28)
at org.nlogo.compiler.ReporterApp.foreach(AstNode.scala:158)
at org.nlogo.compiler.DefaultAstVisitor.visitReporterApp(AstVisitor.scala:27)
at org.nlogo.compiler.TaskVisitor.visitReporterApp(TaskVisitor.scala:22)
at org.nlogo.compiler.ReporterApp.accept(AstNode.scala:168)
at org.nlogo.compiler.DefaultAstVisitor$$anonfun$visitReporterApp$1.apply(AstVisitor.scala:27)
at org.nlogo.compiler.DefaultAstVisitor$$anonfun$visitReporterApp$1.apply(AstVisitor.scala:27)
at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:60)
at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:44)
at scala.collection.TraversableProxyLike$class.foreach(TraversableProxyLike.scala:28)
at org.nlogo.compiler.ReporterApp.foreach(AstNode.scala:158)
at org.nlogo.compiler.DefaultAstVisitor.visitReporterApp(AstVisitor.scala:27)
at org.nlogo.compiler.TaskVisitor.visitReporterApp(TaskVisitor.scala:38)
at org.nlogo.compiler.ReporterApp.accept(AstNode.scala:168)
at org.nlogo.compiler.DefaultAstVisitor$$anonfun$visitStatement$1.apply(AstVisitor.scala:29)
at org.nlogo.compiler.DefaultAstVisitor$$anonfun$visitStatement$1.apply(AstVisitor.scala:29)
at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:60)
at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:44)
at scala.collection.TraversableProxyLike$class.foreach(TraversableProxyLike.scala:28)
at org.nlogo.compiler.Statement.foreach(AstNode.scala:99)
at org.nlogo.compiler.DefaultAstVisitor.visitStatement(AstVisitor.scala:29)
at org.nlogo.compiler.Statement.accept(AstNode.scala:106)
at org.nlogo.compiler.DefaultAstVisitor$$anonfun$visitStatements$1.apply(AstVisitor.scala:30)
at org.nlogo.compiler.DefaultAstVisitor$$anonfun$visitStatements$1.apply(AstVisitor.scala:30)
at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:60)
at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:44)
at scala.collection.TraversableProxyLike$class.foreach(TraversableProxyLike.scala:28)
at org.nlogo.compiler.Statements.foreach(AstNode.scala:75)
at org.nlogo.compiler.DefaultAstVisitor.visitStatements(AstVisitor.scala:30)
at org.nlogo.compiler.Statements.accept(AstNode.scala:92)
at org.nlogo.compiler.DefaultAstVisitor.visitProcedureDefinition(AstVisitor.scala:25)
at org.nlogo.compiler.TaskVisitor.visitProcedureDefinition(TaskVisitor.scala:15)
at org.nlogo.compiler.ProcedureDefinition.accept(AstNode.scala:66)
at org.nlogo.compiler.CompilerMain$$anonfun$compile$2.apply(CompilerMain.scala:43)
at org.nlogo.compiler.CompilerMain$$anonfun$compile$2.apply(CompilerMain.scala:39)
at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:60)
at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:44)
at org.nlogo.compiler.CompilerMain$.compile(CompilerMain.scala:39)
at org.nlogo.compiler.Compiler$.compileMoreCode(Compiler.scala:35)
```