dmd: why not use fully qualified names for types in error messages?

Jonathan M Davis via Digitalmars-d digitalmars-d at puremagic.com
Wed Jun 14 02:24:56 PDT 2017


On Wednesday, June 14, 2017 08:33:26 Jacob Carlborg via Digitalmars-d wrote:
> On 2017-06-14 06:50, Timothee Cour via Digitalmars-d wrote:
> > eg:
> > Error: no property 'IF_gray' for type 'ImageFormat'
> > =>
> > Error: no property 'IF_gray' for type 'foo.bar.ImageFormat'
> >
> > and also, why not show where the symbol is defined?
> >
> > would PR's for that be accepted? is that hard to implement?
>
> Technically, for templates, the fully qualified name include all the
> template arguments. In many (some) cases  this will be way too long to
> print.

It's also frequently something that you wouldn't want to read even if it
were shorter. And having the fully qualified names in the error messages
would tend to make them harder to read in many cases when you're not dealing
with nasty, long templates. Likely, the best solution is for the compiler to
do what it does now in the typical case but to be more specific when needed
for clarity (e.g. when dealing with multiple types with the same name or
with overloads). But the examples that we sometimes get now where the same
name is listed multiple times, and it's actually different symbols from
different modules with the same name are definitely the sort of thing that
indicates that we need to improve how we handle qualifying names in error
messages.

- Jonathan M Davis



More information about the Digitalmars-d mailing list