D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 20136 - opEquals not recognized for AA key
Summary: opEquals not recognized for AA key
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86_64 Linux
: P1 regression
Assignee: No Owner
URL:
Keywords: pull
Depends on:
Blocks:
 
Reported: 2019-08-17 19:43 UTC by Tim
Modified: 2019-08-20 06:20 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Tim 2019-08-17 19:43:11 UTC
The following code compiles with dmd 2.086.0, but not with dmd 2.086.1 or dmd 2.088.0-beta.1:

class Context
{
    size_t[const(Key)] aa;
    bool checkAll;
}

struct Key
{
    Context context;
    int i;
    bool opEquals(ref const Key other) const
    {
        if(context.checkAll && i != other.i)
            return false;
        return true;
    }
}

Dmd 2.086.1 prints the following error message:
Error: AA key type Key does not have bool opEquals(ref const Key) const
Comment 1 RazvanN 2019-08-19 14:08:48 UTC
Regression introduced by: https://github.com/dlang/dmd/pull/9884
Comment 2 Dlang Bot 2019-08-19 14:45:22 UTC
@RazvanN7 created dlang/dmd pull request #10320 "Fix Issue 20136 - opEquals not recognized for AA key" fixing this issue:

- Fix Issue 20136 - opEquals not recognized for AA key

https://github.com/dlang/dmd/pull/10320
Comment 3 Dlang Bot 2019-08-20 06:20:39 UTC
dlang/dmd pull request #10320 "Fix Issue 20136 - opEquals not recognized for AA key" was merged into stable:

- b6394152daf85641fb5083f5df51486870e844a8 by RazvanN7:
  Fix Issue 20136 - opEquals not recognized for AA key

https://github.com/dlang/dmd/pull/10320