[Issue 23291] New: Members of arrays of shared classes cannot be compared

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Aug 10 15:31:45 UTC 2022


https://issues.dlang.org/show_bug.cgi?id=23291

          Issue ID: 23291
           Summary: Members of arrays of shared classes cannot be compared
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: rubytheroobster at yandex.com

The following code worked before 2.099.1.  Now it doesn't:

```d
void main()
{
    shared class C { bool opEquals(const(shared(C)) rhs) const shared  { return
true;}}
    const(C) c = new C();
    const(C)[] a = [c];
    const(C)[] b = [c];
    assert(a[0] == b[0]);
}
```

--


More information about the Digitalmars-d-bugs mailing list