www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 11819] New: Better error message for unrecognized trait error

https://d.puremagic.com/issues/show_bug.cgi?id=11819

           Summary: Better error message for unrecognized trait error
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: diagnostic
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: bearophile_hugs eml.cc


--- Comment #0 from bearophile_hugs eml.cc 2013-12-25 17:42:00 PST ---
Wrong code:


class Foo {}
void main() {
    auto s = __traits(ClassInstanceSize, Foo);
}


DMD 2.065alpha prints (note the false at the second line):


temp.d(3): Error: unrecognized trait ClassInstanceSize


In a similar situation I suggest to print instead:

temp.d(3): Error: uknown trait identifier ClassInstanceSize, did you mean
classInstanceSize?

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