Bug 12307 – Contextfull error diagnostic about AA key type
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-03-06T17:54:00Z
Last change time
2014-05-28T16:46:35Z
Keywords
accepts-invalid, pull
Assigned to
nobody
Creator
k.hara.pg
Comments
Comment #0 by k.hara.pg — 2014-03-06T17:54:33Z
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.