Thread overview
[Issue 17245] Errors about expressions with no effect only are given for basic types
Mar 07, 2017
Jack Stouffer
Mar 07, 2017
Walter Bright
Jul 01, 2017
Vladimir Panteleev
Dec 17, 2022
Iain Buclaw
March 07, 2017
https://issues.dlang.org/show_bug.cgi?id=17245

--- Comment #1 from Jack Stouffer <jack@jackstouffer.com> ---
This should also apply to opCmp, and opBinaryRight

--
March 07, 2017
https://issues.dlang.org/show_bug.cgi?id=17245

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla@digitalmars.com
           Severity|normal                      |enhancement

--
July 01, 2017
https://issues.dlang.org/show_bug.cgi?id=17245

Vladimir Panteleev <dlang-bugzilla@thecybershadow.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dlang-bugzilla@thecybershad
                   |                            |ow.net

--- Comment #2 from Vladimir Panteleev <dlang-bugzilla@thecybershadow.net> ---
(In reply to Jack Stouffer from comment #0)
> Here, the compiler can be helpful by outputing an error if the used opEquals is marked as pure. There's no way that a pure opEquals should be used in an expression with no effect.

A pure opEquals doesn't seem to generate a warning/error either:

struct S
{
    bool opEquals(ref const S s) pure { return false; }
}

void fun()
{
    S a, b;
    a == b;
}

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=17245

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P4

--