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

Boris Carvajal <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #2 from Boris Carvajal <[email protected]> ---
Just quoting forum's reply
https://forum.dlang.org/thread/[email protected]

You can get more info compiling with "-verrors=spec"

"(spec:1) Error: template rational.Rational!int.Rational.opEquals cannot deduce
function from argument types !()(const(Rational!int)) const, candidates are:"

>From reading the docs for function opEquals
(https://dlang.org/spec/operatoroverloading.html#equals).
It shows a templated version with a const modifier.
If you change the function signature to:

bool opEquals(Rhs)(Rhs _) const {return true;} // Note the 'const', and putting
some return back because dustmite removed it

The program links fine.

So it seems a compiler error is gagged that should be exposed and also could be
improved.

--

Reply via email to