Open
Description
Compiler version
tested with 3.6.4, 3.3.5, 3.7.0-RC1
Minimized code
// repro.test.scala
@main def main() = println("Hello World!")
mkdir comp
scalac example.test.scala -d comp
scaladoc comp -d output
Output
class example.test$package cannot be unpickled because no class file was found for denot: val <none>
1 warning found
1 error found
Expectation
Should work.
Known workarounds
- change the file name to not end in
.test.scala
(troublesome, if this is how you're marking your test inputs for Scala CLI) - wrap the main method in an object
- the following works:
object whatever { @main def main() = println("Hello World!") }
Extra context:
- this is the root cause of
doc
with--test
fails on top level@main
VirtusLab/scala-cli#3584 - it seems the package is smh inferred based on the file name, thus the weird error?
- this is highly incompatible with using the doc tool with Scala CLI test sources (breaks when
--test
is enabled)