Ammonite
Ammonite copied to clipboard
error while loading `CompilerExtensions$`
Hi.
Running ammonite under Linux gives me:
$ ./amm
Loading...
Welcome to the Ammonite Repl 2.4.0 (Scala 3.0.0 Java 11.0.10)
@ error while loading CompilerExtensions$,
amm/compiler/src/main/scala-3/ammonite/compiler/CompilerExtensions.scala: Not a directory
@ 1 + 2
| CompilerInterpAPIExtensions,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|value CompilerInterpAPIExtensions is not a member of object ammonite.compiler.CompilerExtensions
| CompilerReplAPIExtensions
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|value CompilerReplAPIExtensions is not a member of object ammonite.compiler.CompilerExtensions
|import _root_.ammonite.compiler.CompilerExtensions.{
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| constructor proxy object CompilerExtensions cannot be used as a value
Compilation Failed
How can I debug this? Where does it expect to find the CompilerExtensions.scala file?
BTW, this seems to be specific to the Scala 3 launcher, 2.4.0-2.13 works just fine:
$ ./amm213
Loading...
Welcome to the Ammonite Repl 2.4.0 (Scala 2.13.6 Java 11.0.10)
@ 1 + 2
res0: Int = 3
I receive this same error on a MBP M1. Please let me know if I should create a separate issue given my OS and such is different :)
ammonite version == 2.4.0
Same error using 2.5.2 with scala 3 under Linux, here are some observations:
- the loading path from error message is the path of ammonite source code, not package/classname and asking for directory, not file:
amm/compiler/src/main/scala-3/ammonite/compiler/CompilerExtensions.scala: Not a directory
- Disable the default predef seems make REPL works
./amm3 --no-default-predef
- this error seems only occurs when ammonite invoked under home directory, so
-
~/amm3
has error if pwd is~
, no error if pwd is elsewhere - similarly,
~/tmp/amm3
has error if pwd is~
, no error if pwd is elsewhere
-
this error seems only occurs when ammonite invoked under home directory, so
1. `~/amm3` has error if pwd is `~`, no error if pwd is elsewhere 2. similarly, `~/tmp/amm3` has error if pwd is `~`, no error if pwd is elsewhere
That is an interesting observation, @chikei !
This really seems to happen only when the script is called amm
and is located in the current directory:
$ ./amm
Loading...
Welcome to the Ammonite Repl 2.5.2 (Scala 3.1.1 Java 11.0.12)
@ error while loading CompilerExtensions$,
amm/compiler/src/main/scala-3/ammonite/compiler/CompilerExtensions.scala: Not a directory
Bye!
$ mv amm foobar
$ ./foobar
Loading...
Welcome to the Ammonite Repl 2.5.2 (Scala 3.1.1 Java 11.0.12)
@ 1 +1
res0: Int = 2
@ Bye!
Still, this seems some kind of regression in comparison to the Scala 2.13 REPL which just works in this case.