I am starting a small Scala Native command line project where I try to use scopt for the CLI parsing.
I have noticed that another Sacla Native project (scalals) uses scopt as well.
However when I try to compile my project as Scala Native project, I get an “Unknown type scopt.OParser$” error. Here some, hopefully relevant, bits of the stack trace:
[error] Unknown type scopt.OParser$, referenced from:
method cztools.Main$.main(java.lang.String[]): scala.runtime.BoxedUnit at CzDiff.scala:26
static method cztools.Main.main(java.lang.String[]): scala.runtime.BoxedUnit at CzDiff.scala:25
...
Exception in thread "main" [info] Total (1124 ms)
scala.scalanative.linker.LinkingException: Unreachable symbols found after classloading run. It can happen when using dependencies not cross-compiled for Scala Native or not yet ported JDK definitions.
at scala.scalanative.build.ScalaNative$.$anonfun$withReachabilityPostprocessing$3(ScalaNative.scala:94)
at scala.concurrent.Future.$anonfun$flatMap$1(Future.scala:307)
...
So I wonder, is scopt indeed usable under Scala Native? (scalals seems to compile fine to Native.)
Or are there portions of scopt which are not Native compatible?
Also, I use Scala CLI` as build tool, does this possibly stuff up the Native compile?
Thanks for pointers!