Summary: Error messages for missing properties must be
           Product: D
           Version: D1 & D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from Andrej Mitrovic <> 2011-03-08 
10:18:35 PST ---
This is a notorious error message that pops up from time to time due to
human-nature (typos). Here's a trivial example:

module test;

void main()
    auto foo = [4, 5, 6, 7];

And the error:
test.d(6): Error: undefined identifier module test.empty

When a property is not found, the error message should reflect that there is no
such property for symbol 'foo', instead of saying there's no identifier
'empty', which makes no sense at all (unless you count in UFCS, which comes
into play here if you import std.array). 

I want this kind of error message to appear:
test.d(6): Error: foo has no property 'empty'

The above test case may be too trivial to notice just how damaging the original
error message is. 

I've had a case in my code where I've had a couple of levels of pointer
indirection (due to how a C library worked), I've had a typo and I was getting
this same kind of error. It was quite frustrating to spend 30+ minutes on
something as silly as a typo due to the error message pointing at something
completely different.

An error message that lies can be as bad as a lying comment in a piece of code.
Can we improve this, please?

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to