www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 19541] New: Confusing error message about missing opEquals


          Issue ID: 19541
           Summary: Confusing error message about missing opEquals for AA
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: acehreli yahoo.com

struct S {
  bool opEquals(ref const(S) that) const {

struct T {
  string[S] aa;    // <-- Compilation error

void main() {

  Error: AA key type `S` does not have `bool opEquals(ref const S) const`

The message is confusing because the AA key type S satisfies what it says.

Apparently, the problem is actually with a compilation error inside that
function but the user is fooled by the message and is now looking for
unnecessary workarounds instead of fixing the compilation error.


Jan 02