Incomprehensible error message

H. S. Teoh hsteoh at quickfur.ath.cx
Tue Mar 20 21:18:01 UTC 2018


On Tue, Mar 20, 2018 at 10:04:30PM +0100, Jacob Carlborg via Digitalmars-d-learn wrote:
> On 2018-03-19 19:03, H. S. Teoh wrote:
> 
> > Yeah, the compiler really ought to be outputting FQNs in error
> > messages, since otherwise you get baffling A != A messages.  Though
> > outputting FQNs everywhere has the tendency of bloating error
> > messages to unreadable lengths, esp. when templates are involved.
> > :-(  (Though fortunately, no templates are involved in this case.)
> 
> The compiler could output the FQN names only when the non qualified
> names are the same. Should hopefully reduce the bloated error
> messages.
[...]

Yeah, I thought about that too, but then it wouldn't be easy to
implement, since you wouldn't be able to easily predict whether or not
to use an FQN name when you've detected an error and just need to print
an error and bailout.  It needs to be automated in order to be
maintainable (nobody wants to go through thousands of compiler errors
and insert complex logic to decide which symbol(s) should be FQN).
Which means error messages would need to be constructed as an abstract
object that the error message printer can then inspect to determine
which symbol(s) should be FQNs.

Either way, it will require a lot of effort to pull off.


T

-- 
For every argument for something, there is always an equal and opposite argument against it. Debates don't give answers, only wounded or inflated egos.


More information about the Digitalmars-d-learn mailing list