Summary: Require opEquals/opCmp in a class the defines toHash
           Product: D
           Version: 2.040
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from 2010-02-23 17:38:34 PST ---
This code compiles and runs:

class Foo {
    int a, b;
    override hash_t toHash() { return a + b; }
    this(int aa, int bb) { this.a = aa; this.b = bb; }
void main() {
    int[Foo] aa1;
    aa1[new Foo(1, 2)] = 10;

I think in a class it's not that useful to define toHash and not define
opEquals/opCmp too. So when a toHash is defined, the compiler can raise a
warning to require the definition of an opEquals/opCmp too.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to