www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12307] New: Contextfull error diagnostic about AA key type

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

           Summary: Contextfull error diagnostic about AA key type
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: accepts-invalid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: k.hara.pg gmail.com


--- Comment #0 from Kenji Hara <k.hara.pg gmail.com> 2014-03-06 17:54:33 PST ---
Test case:

struct S1 { int opCmp(T : typeof(this))(T) { return 0; } }
void main()
{
    int[S1] aa1;    // a
    int[S2] aa2;    // b
}
struct S2 { int opCmp(T : typeof(this))(T) { return 0; } }

The case 'a' will print the error:
Error: associative array key type S1 does not have 'const int opCmp(ref const
S1)' member function

But the case 'b' doesn't. It's order dependent bug.

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