Skip to content

The doctool has trouble with files named .test.scala containing top-level @main function#22866

@Gedochao

Description

@Gedochao

Compiler version

tested with 3.6.4, 3.3.5, 3.7.0-RC1

Minimized code

// repro.test.scala@main defmain() = println("Hello World!")
mkdir comp scalac example.test.scala -d comp scaladoc comp -d output

Output

classexample.test$packagecannotbeunpickledbecausenoclassfilewasfoundfordenot: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:
    objectwhatever{@main defmain() = println("Hello World!") }

Extra context:

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions