Hi everyone,

there is https://issues.dlang.org/show_bug.cgi?id=21180 bug, anyone knows how to avoid it?

Test case:
-------------
import std;

class Silly {
    bool opEquals(const Silly silly) const @safe {
        return silly is this;
    }

    alias opEquals = Object.opEquals;
}

bool comp(T)() @safe {
    return new T() == new T();
}

void main()
{
    comp!Silly.writeln;
    comp!(const Silly).writeln;
    comp!(immutable Silly).writeln;
}
-------------

It always tries to call Object.opEquals, when narrower overload should've been selected.

- Alex.

Reply via email to