Skip to content

Commit 51e2c66

Browse files
committed
Update README
1 parent 4cab7b2 commit 51e2c66

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

README.md

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,33 @@
11

2-
## What is scala-helpful-compiler-errors?
2+
## Scala helpful compiler errors
33

4-
scala-helpful-compiler-errors is a list of Scala compiler errors that could be more helpful, especially for newcomers to Scala.
4+
A list of Scala compiler errors that could be more helpful, especially for newcomers to Scala.
55

6-
Experienced Scala programmers maintain a mental map of compiler error -> actual problem. In many cases a compiler error can't know the "actual" problem, but in many cases it can or make a helpful guess.
6+
The list is focused on Scala 3's Dotty compiler. One day this list could be used to help a [larger project](https://contributors.scala-lang.org/t/towards-better-error-messages-in-scalac/1470/31) around compiler errors. Such a project seems unlikely to occur for Scala 2.13's scalac, which is why this list is Dotty-specific.
77

8-
The list of compiler errors focused on Scala 3's Dotty compiler. The idea behind this project is to build up a list of compiler errors that could one day be an input into a [larger project](https://contributors.scala-lang.org/t/towards-better-error-messages-in-scalac/1470/31) to make compiler errors more helpful. Such a project seems unlikely to occur for Scala 2.13's scalac, which is why this list is Dotty-specific.
9-
10-
## PRs Welcome
8+
## Pull requests welcome
119

1210
Please submit pull requests with Dotty errors that could be more helpful, especially for newcomers to Scala.
1311

14-
## Template for new compiler errors or warnings
12+
Use this template:
1513

1614
#### $errorName
1715

18-
* Scastie link: $scastieLink (here's a [starter](https://scastie.scala-lang.org/G4zbEq5dTFqSnRryRnTzwg))
16+
* [Scastie example](https://scastie.scala-lang.org/G4zbEq5dTFqSnRryRnTzwg)
1917
* Current error msg:
2018
```
2119
// paste output of dotty compiler error or warning
2220
```
23-
* Suggested helpful msg: `Oh no, it broke. Suggestion: don't break it`
21+
* Example helpful msg: `Oh no, it broke. Suggestion: don't break it`
2422

2523
## List of Dotty compiler errors that could be more helpful
2624

27-
#### If statement missing an else branch
25+
### If statement missing an else branch
2826

29-
* Scastie link: https://scastie.scala-lang.org/G4zbEq5dTFqSnRryRnTzwg
27+
* [Scastie example](https://scastie.scala-lang.org/G4zbEq5dTFqSnRryRnTzwg)
3028
* Current error msg:
3129
```
3230
Found: Unit
3331
Required: Int
3432
```
35-
* Suggested helpful msg: `The result type of this if statement must be an Int, but there's no else branch, so it returns Unit on else. Suggestion: add an else branch`
33+
* Example helpful msg: `The result type of this if statement must be an Int, but there's no else branch, so it returns Unit on else. Suggestion: add an else branch`

0 commit comments

Comments
 (0)