[Issue 23739] Can't return by ref from opApply iteration
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Feb 27 23:58:17 UTC 2023
https://issues.dlang.org/show_bug.cgi?id=23739
--- Comment #4 from timon.gehr at gmx.ch ---
(In reply to kinke from comment #2)
> The 1st testcase just requires a `foreach (ref x; s)`, which I think is
> consistent.
>
> The 2nd one never sets `S.x` before dereferencing it, so adding `ref` there
> still causes a segfault.
Oops. Indeed I screwed up when trying to create a reduced test case... My bad.
Thanks!(In reply to timon.gehr from comment #3)
> (In reply to kinke from comment #2)
> > The 1st testcase just requires a `foreach (ref x; s)`, which I think is
> > consistent.
> >
> > The 2nd one never sets `S.x` before dereferencing it, so adding `ref` there
> > still causes a segfault.
>
> Oops. Indeed I screwed up when trying to create a reduced test case... My
> bad. Thanks!
See Issue 23751.
--
More information about the Digitalmars-d-bugs
mailing list