File tree Expand file tree Collapse file tree 1 file changed +25
-1
lines changed
docs/_docs/reference/error-codes Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Original file line number Diff line number Diff line change 11---
2+ layout : index
23title : Error codes
3- ---
4+ ---
5+
6+ The Scala 3 compiler assigns a unique error code to each type of error it can emit.
7+ These codes appear in compiler output in the format ` [E001] ` , ` [E007] ` , etc.
8+
9+ This section documents each error code with:
10+
11+ - ** Description** — what the error means and when it occurs
12+ - ** Example** — code that triggers the error
13+ - ** Error output** — the actual compiler message you'll see
14+ - ** Solution** — how to fix the problem
15+
16+ ## Using error codes
17+
18+ When you encounter an error, you can use the ` -explain ` flag to get more detailed information:
19+
20+ ``` bash
21+ scala compile -explain MyFile.scala
22+ ```
23+
24+ You can also look up any error code directly in this documentation by its number (e.g., E007 for type mismatch errors).
25+
26+ Browse the full list in the sidebar to find documentation for any specific error code.
27+
You can’t perform that action at this time.
0 commit comments