On Friday, 13 May 2022 at 21:07:12 UTC, Christopher Katko wrote:
Is there any way we can get numbered errors like C++ / Microsoft have?

 E2040 Declaration terminated incorrectly

Because then we could easily have a wiki for common error cases with code snippets of it occurring, and a fix for it. Common triggers of this error vs the proper code.

And a neat feature that Allegro.cc does, it automatically scans forum posts for usages of Allegro functions (e.g. al_draw_bitmap() man page will include links to posts that ask about al_draw_bitmap and has a Yes/No question next to it "was this a helpful post" so you can remove bad matches). Here it would be even easier than matching random questions because error codes are specific string literals ("E2040") and not some sort of regex attempt to match someone asking a question about 'R[][][] datatypes' or something like that.

Here is an example:

https://www.allegro.cc/manual/5/al_draw_bitmap

and an C++ error page:

https://docwiki.embarcadero.com/RADStudio/Sydney/en/E2040_Declaration_terminated_incorrectly_(C%2B%2B)

We discussed this a while ago in a foundation meeting. The details didn't really get hashed out but I think we can definitely try it.

I have a PR which alters the error message you get if you do

```d
void main()
{
  func() == 43;
}
```

This is an example of an error message which could be counterintuitive to a new D programmer, e.g. maybe they thought it would act like an assert or whatever, so we can link to a some html somewhere on dlang.org

Reply via email to