You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// See http://www.lihaoyi.com/Ammonite/#Configuration// Not really digging the @ sign prompt.
repl.prompt() ="\n> "// Love the double negative... enable compiler warnings
compiler.settings.nowarnings.value =false// Load utility definitions shared with default scala REPLtry load.exec(ammonite.ops.home/".config"/'scala/"replinit.scala")
catch { case_: Exception=> println("=== replrc not loaded! ===") }
This was working fine in 0.5.8, but in 0.6.0 there's an exception. The real contents of my ~/.config/scala/replinit.scala seem to be irrelevant, I can reduce it to this and it still blows up:
valfoo=1+1
If I remove the try, here's the stack trace I get from amm failing to launch:
$ amm
Loading...
Exception in thread "main" java.lang.RuntimeException: Error during Predef:
at ammonite.repl.interp.Interpreter$$anonfun$17.apply(Interpreter.scala:522)
at ammonite.repl.interp.Interpreter$$anonfun$17.apply(Interpreter.scala:511)
at scala.collection.LinearSeqOptimized$class.foldLeft(LinearSeqOptimized.scala:124)
at scala.collection.immutable.List.foldLeft(List.scala:84)
at ammonite.repl.interp.Interpreter.<init>(Interpreter.scala:511)
at ammonite.repl.Repl.<init>(Repl.scala:41)
at ammonite.repl.Main.instantiateRepl(Main.scala:57)
at ammonite.repl.Main.run(Main.scala:68)
at ammonite.repl.Main$$anonfun$main$2.apply(Main.scala:258)
at ammonite.repl.Main$$anonfun$main$2.apply(Main.scala:244)
at scala.Option.foreach(Option.scala:257)
at ammonite.repl.Main$.main(Main.scala:244)
at ammonite.repl.Main.main(Main.scala)
Caused by: java.lang.NullPointerException
at scala.collection.generic.GenericTraversableTemplate$$anonfun$flatten$1.apply(GenericTraversableTemplate.scala:172)
at scala.collection.generic.GenericTraversableTemplate$$anonfun$flatten$1.apply(GenericTraversableTemplate.scala:171)
at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33)
at scala.collection.mutable.WrappedArray.foreach(WrappedArray.scala:35)
at scala.collection.generic.GenericTraversableTemplate$class.flatten(GenericTraversableTemplate.scala:171)
at scala.collection.AbstractTraversable.flatten(Traversable.scala:104)
at ammonite.repl.interp.Frame$.mergeImports(ClassLoaders.scala:22)
at ammonite.repl.interp.Interpreter.loop$1(Interpreter.scala:204)
at ammonite.repl.interp.Interpreter.processCorrectScript(Interpreter.scala:220)
at ammonite.repl.interp.Interpreter.processScript(Interpreter.scala:249)
at ammonite.repl.interp.Interpreter.processExec(Interpreter.scala:112)
at ammonite.repl.interp.Interpreter$$anon$1$load$.apply(Interpreter.scala:331)
at ammonite.repl.interp.Interpreter$$anon$1$load$.exec(Interpreter.scala:337)
at ammonite.predef.LoadedPredef$.<init>(LoadedPredef.scala:10)
at ammonite.predef.LoadedPredef$.<clinit>(LoadedPredef.scala:10)
at ammonite.predef.LoadedPredef.$main(LoadedPredef.scala)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at ammonite.repl.interp.Evaluator$$anon$1.ammonite$repl$interp$Evaluator$$anon$$evalMain(Evaluator.scala:173)
at ammonite.repl.interp.Evaluator$$anon$1$$anonfun$processScriptBlock$2$$anonfun$apply$16.apply(Evaluator.scala:341)
at ammonite.repl.interp.Evaluator$$anon$1$$anonfun$processScriptBlock$2$$anonfun$apply$16.apply(Evaluator.scala:338)
at ammonite.repl.Catching.map(Util.scala:36)
at ammonite.repl.interp.Evaluator$$anon$1$$anonfun$processScriptBlock$2.apply(Evaluator.scala:338)
at ammonite.repl.interp.Evaluator$$anon$1$$anonfun$processScriptBlock$2.apply(Evaluator.scala:335)
at ammonite.repl.Res$Success.flatMap(Util.scala:54)
at ammonite.repl.interp.Evaluator$$anon$1.processScriptBlock(Evaluator.scala:335)
at ammonite.repl.interp.Interpreter$$anonfun$processModule0$1$$anonfun$apply$4.apply(Interpreter.scala:101)
at ammonite.repl.interp.Interpreter$$anonfun$processModule0$1$$anonfun$apply$4.apply(Interpreter.scala:101)
at ammonite.repl.interp.Interpreter.withContextClassloader(Interpreter.scala:61)
at ammonite.repl.interp.Interpreter$$anonfun$processModule0$1.apply(Interpreter.scala:100)
at ammonite.repl.interp.Interpreter$$anonfun$processModule0$1.apply(Interpreter.scala:99)
at ammonite.repl.interp.Interpreter.loop$1(Interpreter.scala:202)
at ammonite.repl.interp.Interpreter.processCorrectScript(Interpreter.scala:220)
at ammonite.repl.interp.Interpreter.processScript(Interpreter.scala:249)
at ammonite.repl.interp.Interpreter.processModule0(Interpreter.scala:96)
at ammonite.repl.interp.Interpreter$$anonfun$17.apply(Interpreter.scala:513)
... 12 more
The text was updated successfully, but these errors were encountered:
Probably obvious, but I can remove the predef.scala or comment out the load.exec and the REPL launches without problem. Running the load.exec in the REPL after it's launched works fine.
Awesome, new release in Homebrew before I even had the chance to try the fix. Thanks!
Not sure if this is at all related, but I seem to have lost all error reporting in 0.6.1:
$ amm -f /dev/null
Loading...
Welcome to the Ammonite Repl 0.6.1
(Scala 2.11.8 Java 1.8.0_92)
@ throw new RuntimeException("wat")
@ throw new IllegalStateException("wat")
Squelching any custom predef there. lastException works, but I'm assuming completely silent failures wasn't a conscious decision? Should I open a new issue for this?
I have the following
~/.ammonite/predef.scala
:This was working fine in 0.5.8, but in 0.6.0 there's an exception. The real contents of my
~/.config/scala/replinit.scala
seem to be irrelevant, I can reduce it to this and it still blows up:If I remove the
try
, here's the stack trace I get fromamm
failing to launch:The text was updated successfully, but these errors were encountered: