-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Document Scala compiler error codes #24734
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
base: main
Are you sure you want to change the base?
Conversation
|
is there an automated process to check for addition of new error codes? |
Not yet but I'll add one |
|
We could also link to these pages from DiagnosticRelatedInformation, it's available in the sbt interfaces. |
|
Ach, no that would have to be another field, which is not exposed here :/ |
|
We could anyway link the codes in metals automatically once this is merged, which will work on all Scala 3 versions |
…om messages.scala
…erateReferenceDocumentation` (crashed)
… repl, tasty-inspector, staging, etc.


Resolves #24720
All identified error codes produced by compiler are now documented in the reference docs.
-explain), and examples how to fix given problem.scala -S 3.nightly test --with-compiler project/scripts/checkErrorCodeSnippets.test.scala -- +a +l +cIt validates that all error codes (unless explicitlly excluded) are well defined: has example snippet, output errors and solutions. This might also check for additional attributes, eg. :
untiltag for inactive codes containg the last version when given error code was emmitedsincetag for code introduced after 3.0.0 - first stable version when given error is emmitedscala3-compiler, this allows to test changes for manually published versions of the compiler, by providing explicit-S <versionwe can test against any version of the compiler, including locally published ones.Piggy backs fixes that would be required to have correct assertions in generated scaladoc (would be most likelly cherry-picked before merge): - allow to specific `sc-opts:*` to pass specify scalacOptions that would be passed to the snippetCompiler - show position of snippets that failed to compileThe changes above were extracted to #24755
Piggy backed changes:
scaladoc/generateReferenceDocumentationstarted to crash after addition of first Markdown snippet - it was caused by classpath/scaladoc setting issue. The problem was fixed, by removing no longer required__fake__.scalafile which was used in Scala 3.1 and earlier to workaround requirement of having at least 1 Scala source.Documentation itself was generated using LLM agents and requires manual review - mostly for correctness of descriptions, code snippets itself are validated to produce correct error codes unless marked with
sc:nocompile(see list of non-reproductible error codes in created tool).Here's the gist with context used to instrument agents