[Issue 21802] opAssign and opOpAssign treat lazy void parameters inconsistently

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Apr 6 15:19:34 UTC 2021


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

--- Comment #2 from thomas.bockman at gmail.com ---
This regression also affects classes, which previously worked up through 2.060:

//////////////////////////////////
module app;

class A {
    auto opAssign(lazy void foo) {
        foo(); }
    auto opOpAssign(string op)(lazy void foo) {
        foo(); }
}

void bar(int x) { }

void main () {
    A a = new A;
    a ~= bar (1); // OK
    a = bar (1); // Error: expression bar(1) is void and has no value
}
//////////////////////////////////

--


More information about the Digitalmars-d-bugs mailing list