Thread overview
Poor error messages
May 12, 2005
Derek Parnell
May 13, 2005
Stewart Gordon
May 12, 2005
I was getting the message ...

util\macro.d(20): function util.macro.append conflicts with std.file.append
at z:\dmd\src\phobos\std\file.d(178)

I've finally worked out what was causing it, but the message itself is almost useless. The actually line of code that triggered this message was in another file altogether. A much better message would have been something more like ...

build.d(598): cannot resolve function 'append' usage between function
util.macro.append(20) and z:\dmd\src\phobos\std\file.append(178)

-- 
Derek
Melbourne, Australia
12/05/2005 12:06:10 PM
May 12, 2005
"Derek Parnell" <derek@psych.ward> wrote in message news:2xur0q6fxfkn.1hzrq7714ywge.dlg@40tude.net...
>I was getting the message ...
>
> util\macro.d(20): function util.macro.append conflicts with
> std.file.append
> at z:\dmd\src\phobos\std\file.d(178)
>
> I've finally worked out what was causing it, but the message itself is
> almost useless. The actually line of code that triggered this message was
> in another file altogether. A much better message would have been
> something
> more like ...
>
> build.d(598): cannot resolve function 'append' usage between function
> util.macro.append(20) and z:\dmd\src\phobos\std\file.append(178)

I know exactly what you mean.  It's even worse when you write some code that depends on one module, leave it for a few days, then import a new module - and you have no idea what you wrote that's causing the conflict!


May 13, 2005
Derek Parnell wrote:
> I was getting the message ...
> 
> util\macro.d(20): function util.macro.append conflicts with std.file.append
> at z:\dmd\src\phobos\std\file.d(178)
> 
> I've finally worked out what was causing it, but the message itself is
> almost useless. The actually line of code that triggered this message was
> in another file altogether. A much better message would have been something
> more like ...
> 
> build.d(598): cannot resolve function 'append' usage between function
> util.macro.append(20) and z:\dmd\src\phobos\std\file.append(178)

The two conflicting functions should be given using the same notation. Moreover, we ought to stick to using filenames before (linenumber), both for consistency and for integrability with code editors.  Also, using the word "function" here is a bit inappropriate as they might not both be functions.

My vote goes to this form

build.d(598): name 'append' defined in multiple modules:
    util\macro.d(20)
    z:\dmd\src\phobos\std\file.d(178)

Stewart.

-- 
My e-mail is valid but not my primary mailbox.  Please keep replies on the 'group where everyone may benefit.