Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Gedochao opened this issue Mar 24, 2025 · 0 comments

Comments

@Gedochao
Copy link
Contributor

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:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant