Would be nice if compiler gave more information!

Jonathan M Davis newsgroup.d at jmdavisprog.com
Fri Jun 15 04:18:49 UTC 2018


On Friday, June 15, 2018 03:54:34 DigitalDesigns via Digitalmars-d wrote:
> On Friday, 15 June 2018 at 02:47:56 UTC, Jonathan M Davis wrote:
> > On Friday, June 15, 2018 02:31:49 DigitalDesigns via
> >
> > Digitalmars-d wrote:
> >> > I am getting the compiler to crash from a different problem
> >> > after I moved some files around. I have no idea where the
> >> > error is now.
> >>
> >> There was a module that was included that was crashing the
> >> compiler for some reason. When I removed it, which wasn't part
> >> of the original project the compiler didn't crash.
> >>
> >> So, this is either a bug in modules or something in the module
> >> that crashed.
> >>
> >> the two modules I removed were sumtype and openmethods... both
> >> public.
> >
> > Regardless of whether there's a bug in any of the modules that
> > you're using, the compiler should never crash. If it does,
> > there's a bug in the compiler.
> >
> > - Jonathan M Davis
>
> I know, but without having any type of feedback it becomes
> extremely difficult to find the code to figure out what is going
> on. I only was lucky to find the module issue relatively quickly
> because I just added a bunch of modules and it was working right
> before. If I would have not built the code right after or would
> have not tried to figure out what was going on then it would
> become a harder problem. Considering that some code I added
> before also asserted would have lead me to think it was related
> to that problem and not simply including a module.
>
> So, it should be very important to have some type of info that
> connects the error to what the compiler was doing. With large
> problems it is not easy to reduce to a test case that shows the
> problem directly.
>
> I think a debug build dmd would be the easiest way. It is built
> with the release version so they are identical... but it would
> help users to quickly help with compiler errors rather than
> having to go build the compiler themselves, etc.

I'm not against there being an easy way to get at a debug build of the
compiler without building it yourself, but really, compiler errors shouldn't
be happening often enough for it to matter much. And in most cases, the
people who first run into the problem aren't the ones who end up debugging
it anyway.

Regardless, if you haven't yet, I'd suggest using dustmite to reduce the
problem:

https://github.com/CyberShadow/DustMite/wiki

- Jonathan M Davis



More information about the Digitalmars-d mailing list