[Issue 3913] New: Bad error message with wrong enum

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Mar 9 08:18:58 PST 2010


http://d.puremagic.com/issues/show_bug.cgi?id=3913

           Summary: Bad error message with wrong enum
           Product: D
           Version: 2.041
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: diagnostic
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: bearophile_hugs at eml.cc


--- Comment #0 from bearophile_hugs at eml.cc 2010-03-09 08:18:57 PST ---
This D2 program is wrong:

void main() {
    enum Foo { first, second }
    enum Foo f = Foo.secod;
}

It prints:

bug.d(3): Error: no property 'secod' for type 'int'

A better error message can be:

bug.d(3): Error: no enumerator 'secod' in enum 'Foo'. Did you mean 'second'?

(The possible match 'second' is chosen in the namespace of Foo only.)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list