April 05, 2021 [Issue 21802] New: opAssign and opOpAssign treat lazy void parameters inconsistently | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=21802 Issue ID: 21802 Summary: opAssign and opOpAssign treat lazy void parameters inconsistently Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW Severity: regression Priority: P1 Component: dmd Assignee: nobody@puremagic.com Reporter: thomas.bockman@gmail.com This used to work up through 2.061: ////////////////////////////////// module app; struct A { auto opAssign(lazy void foo) { foo(); } auto opOpAssign(string op)(lazy void foo) { foo(); } } void bar(int x) { } void main () { A a; a ~= bar (1); // OK a = bar (1); // Error: expression bar(1) is void and has no value } ////////////////////////////////// (Inspired by this forum discussion: https://forum.dlang.org/post/ihsyagkqntidnglxoxlq@forum.dlang.org) -- |
Copyright © 1999-2021 by the D Language Foundation