Better error messages - from reddit

H. S. Teoh hsteoh at quickfur.ath.cx
Tue Mar 5 00:03:39 UTC 2019


On Mon, Mar 04, 2019 at 11:54:34PM +0000, Adam D. Ruppe via Digitalmars-d wrote:
> On Monday, 4 March 2019 at 23:46:55 UTC, Nicholas Wilson wrote:
> > https://github.com/dlang/DIPs/pull/131
> 
> Seems overkill to me, though it might be useful in some cases, the
> compiler already has enough information in current code. It just isn't
> telling us what it knows.
> 
> (that said i prolly wouldn't vote against it, i also don't see a need
> to change code to improve error messages.)

Yeah, I think the DIP would be a welcome improvement, but OTOH Adam's
idea already works without needing to change existing code, because the
compiler already knows what it knows.

Given that programmers tend to be lazy (why spend the time writing
elaborate sig constraints when I could be working on the function body
where the real work is done), having the compiler able to emit useful
information *without help from the programmer* is a big plus.

An even bigger plus is that it can be done today with just a little
change in the compiler.


T

-- 
Amateurs built the Ark; professionals built the Titanic.


More information about the Digitalmars-d mailing list