[Issue 20661] New: opEquals not recognized for AA key (take two)
    d-bugmail at puremagic.com 
    d-bugmail at puremagic.com
       
    Tue Mar 10 11:19:46 UTC 2020
    
    
  
https://issues.dlang.org/show_bug.cgi?id=20661
          Issue ID: 20661
           Summary: opEquals not recognized for AA key (take two)
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: ag0aep6g at gmail.com
This is a slight variation of issue 20136, adding `@safe` and a pointer.
Should compile:
----
class Context
{
    size_t[const(Key)] aa; /* Error: AA key type Key does not have bool
opEquals(ref const Key) const */
    bool* checkAll;
}
struct Key
{
    Context context;
    bool opEquals(ref const Key other) @safe const
    {
        auto c = context.checkAll;
        return true;
    }
}
----
--
    
    
More information about the Digitalmars-d-bugs
mailing list