The Scala 3 core maintainers are starting a new campaign to seek out confusing, annoying or unhelpful error/warning messages.
One way to make Scala friendlier to newcomers, and easier to learn, is to help the user when they make a mistake. Error messages and warnings should be there to help the user, not scare them away.
To help collect problematic errors, we have made a new issue template to fill in on the Scala 3 repository.
The template helps you to write the report, by asking what was so confusing/unhelpful about the message, and then gives the option for you to suggest what would make the error more helpful, actionable, etc.
The improvement may be anywhere from more explicit explanation of the source of error, to even adding a quick fix that can be applied automatically.
Please click here to open a new issue!
As someone often frustrated by poor diagnostics, kudos for this effort.
One of the mechanisms I appreciate in error messages is including a link/url that offers more context to the message.
I submitted one, though it may be a bit… frivolous. I was really confused by
lazy val differences between Scala 2/3 while migrating a library. Both gave me confusing messages.
You nicely point out that sometimes messaging tries to be helpful by offering advice, but then the advice is too rigid and does not apply to the context.
An Oderskyism is that the “primary message” ought to be terse, since users quickly learn “what it really means”, and that saying more in the common case is just noise.
If the user has to take an action, such as adding
-explain or clicking a link, they are aware that they are researching and no longer just following a recipe.
I was sorry my submission wasn’t the first under the new labelling, but I was defeated by time zone and also Odersky’s one-week head start when he took up the cause of mismatched lambda parameters. Probably many such efforts are spurred by whatever Odersky had for lunch, and with whom.
this was an excellent example actually! very annoying to apply a suggestion and then that be incorrect also!