Skip to content

Commit 10e3003

Browse files
committed
Setup error-codes/index
1 parent b6368e7 commit 10e3003

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed
Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
11
---
2+
layout: index
23
title: 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+

0 commit comments

Comments
 (0)